2
This script is not working, I just want the Thumb variable to be created if the id Thumb exists, if the script does not exist. It seems that when Thumb doesn’t exist it gives error and the script doesn’t even work. NOTE: I’m only using Notepad++, I don’t see any error messages.
if(document.getElementeByid("thumb") !== null)
{
var thumb = document.getElementeByid("thumb");
}
comandos;
Just warning something for future use, when you want to know if something exists or not, compare with
undefined
, not withnull
.– Máttheus Spoo