Is it bad to tie events to ids that aren't on the page in certain circumstances (based on PHP)? Will it cause code errors and slowness, or will jQuery automatically ignore them?
Should I instead put something like the following on every element that might not be there?
if ( $('#element') ){
$('#element').click(function(event) {}
}
My page setup is a certain edit box is not loaded under certain conditions to keep functions from being tried.. I set it up with a conditional php include because it's based on circumstances in the database that I don't really want to pass through to the front-end.
Right now all the js for the on page is in a single file with a number of functions.