I recently transferred a site to a new host. Reloaded everything, and the javascript that worked fine before is breaking at an element it can’t find. $(‘#emailForm’) is not defined.
Now, the #emailform isn’t on the page, but it wasn’t before either, and JS used to skip this and it would just work. Not sure why this is happening. Any clues
Here is the site I am having the prblem:
jQuery will return an empty jQuery object from
$('#emailForm')if there isn’t an element with theid='emailForm'.One of the following is likely true:
$is undefined.$– in which case you can wrap your code in a quick closure to renamejQueryto$The Closure:
You could
console.log(window.$,window.jQuery);in firebug to check for both of these problems.