javascript error in IE cannot see or workout problem
In IE8 on vista I am getting the following JS error,
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 UTCMessage: Object doesn't support this property or method Line: 28
Char: 2 Code: 0 URI: http://www.safetymaintenancecompany.co.uk/media/js/site.js
Below is my code of said file,
$(document).ready(function(){
Cufon.replace('dd h1', { 'fontSize': '50px', 'letterSpacing': '-4px开发者_如何学C'} ); // 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
}
}
});
});
I honestly cannot see an problems with this code, is there some wrong with it?
If I can count correctly, that's the $("#contactForm").validate line, so maybe $("#contactForm") returns null? You might try alert-in the result first, just to be sure if $("#contactForm") is the problem, or a missing validation plugin.
It turned out that IE8 did not appreciate me hot linking to the validation library, however this was only in Vista. I realise that sounds almost impossible but those are the facts.
精彩评论