I'm hoping some fresh eyes can see what I'm missing. I have a page (in WordPress site) that works just fine in Firefox, Chrome, Opera & Safari but not in IE. To see if it's even executing anything, I've placed an alert in the first line of the document.ready function and it displays on all the browsers except in IE (tried it on IE7 and IE9).
Here's the document.ready function. Can anyone see any reason why this would not execute in IE?
<!-- language: lang-js -->
$(document).ready(function () {
alert('in .ready function');
//$("input:text:visible:first").focus();
$(window).scrollTop();
// $(this).scrollTop(0);
$("#u_phone").mask("(999) 999-9999");
$('#fab_result').hide();
$('#fab_header').hide();
$('#optIn').hide();
$('div.message').show();
$('#mymap').show();
$("#my_form").validate();
if ($("#u_firstname").length > 0) {
$("#u_firstname").rules("add", {
required: true,
minlength: 5,
messages: {
required: " This field is required "
}
});
}
if ($("#u_email").length > 0) {
$("#u_email").rules("add", {
required: true,
email: true,
messages: {
required: " This field is required "
}
});
}
if ($("#u_phone").length > 0) {
$("#u_phone").rules("add", {
required: true,
messages: {
required: " This field is required "
}
});
}
if ($("#u_custom_20").length > 0) {
$("#u_custom_20").rules("add", {
required: true,
minlength: 3,
messages: {
required: " This field is required "
}
});
}
var mapsterOpts = {
fillOpacity: 0.5,
render_highlight: {
fillColor: '2aff00',
stroke: true,
strokeWidth: 2
},
render_select: {
fillColor: 'ff000c',
stroke: false
},
fadeInterval: 5000,
isSelectable: false
},
mainOpts = $.extend({}, mapsterOpts, {
mapKey: 'province',
onClick: clickMain
}),
detailOpts = $.extend({}, mapsterOpts, {
onClick: clickDetail
});
$('#canada-map').mapster(mainOpts);
});
No-the alert doesn't fire in IE. – IMZvonko Mar 27 '12 at 14:15