在 Vista 上的 IE8 中,我收到以下 JS 错误,
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1;
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Thu, 1 Sep 2011 12:18:24 UTC消息:对象不支持此属性或方法行:28
block 引用>
字符:2 代码:0 URI:
http://www.safetymaintenancecompany.co.uk/media/js/site.js下面是我的所述文件的代码,
$(document).ready(function(){ Cufon.replace('dd h1', { 'fontSize': '50px', 'letterSpacing': '-4px'} ); // Works without a selector engine $('#slides').slides({ preload: true, preloadImage: '../images/loading.gif', play: 5000, pause: 2500, slideSpeed: 600, hoverPause: true, generatePagination:false }); //$('footer').height( ($(window).height() - $('#main').height() + "px" )); $('.title').click(function(event){ event.preventDefault(); }); $('.basic li > h2').hover(function(event) { $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); }); $("#contactForm").validate({ rules: { name: "required", email_address: { required: true, email: true }, phone_number: { required: true } } });
});
老实说,我看不出这段代码有什么问题,它有什么问题吗?
最佳答案
如果我能正确计数,那就是 $("#contactForm").validate 行,所以也许 $("#contactForm") 返回 null ?您可以先尝试在结果中发出警报,只是为了确定 $("#contactForm") 是否是问题所在,或者是否缺少验证插件。
关于IE 中的 javascript 错误无法查看或解决问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7270357/