Testing for presence of element on a page
I think I'm making a jQuery syntax error, have a look at the code below.
if ($('#this-selector-is-on-the-page')){ // check for existence of selector
// Want to do this stuff, and it is executing, so OK.
}
if ($('#this-selector-is-NOT-on-the-page'){ // check for existence of selector
// Don't want to do this stuff on this page, but it is executing anyway.
}
What is my mistake?