在IE8在Vista上,我得到以下JS錯誤,的JavaScript在IE錯誤不能看到或鍛鍊問題
用戶代理:Mozilla的/ 4.0(兼容; 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)
時間戳:Thu,1 Sep 2011 12:18:24 UTC信息:對象不支持此屬性或方法線:28
字符: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
}
}
});
} );
我真的不能看到這個代碼的問題,是否有一些錯誤呢?
哪一行是28行?如果是$(「#contactForm」)。validate({'那麼也許是因爲驗證插件沒有加載。 – RoToRa
是IE中的問題,那麼firefox怎麼樣?你能在你的js上達到28行嗎? –
RoToRa說,似乎最有可能,但它會發生在所有的瀏覽器,如果這是問題。這是隻有IE8,或者是唯一的瀏覽器,你已經測試它? – jmar777