Javascript and IE7
26 November 2009Just a quick post. Something to look for with Internet Explorer 7 and Javascript (not JQuery specifically). The following will work fine in IE8, FF and even IE6, but not IE7:
$("#foo").validate({
rules: {
firstname: 'required',
lastname: 'required',
phone: 'required',
email: {required:true,email:true},
street: 'required',
city: 'required',
state: 'required',
postcode: 'required',
service_areas: 'required',
}
});
Whereas this will:
$("#foo").validate({
rules: {
firstname: 'required',
lastname: 'required',
phone: 'required',
email: {required:true,email:true},
street: 'required',
city: 'required',
state: 'required',
postcode: 'required',
service_areas: 'required'
}
});
Spot the difference? That single comma after the last rule hash. That will stop IE7 from processing Javascript and result in your other events not getting fired.
« Reducing HTTP requests using data URLs to increase performance Custom keyboard layout in Xorg »Possibly Similar Pages
- Non-blocking Google Analytics 2009-03-19
- Non-blocking Google Analytics Revisited 2009-05-11
- Hosting your own OpenID with Nginx, SimpleID and Yadis 2009-02-09
Comments on this post
blog comments powered by Disqus