我使用jQuery,以及Twitter的引导我的网站。我正在使用滚动间谍,轮播和AJAX表单提交。我已经在三个浏览器中测试了这些。他们在Chrome和FF中工作,但不在Internet Explorer中工作。JavaScript的不兼容性问题与IE8
进出口新的技术,所以我可能错过了一些东西的兼容性 重要下面是脚本的即时通讯使用。
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/parsley.js"></script>
<!-- script to make the navigation scroll -->
<script>
var $root = $('html, body');
$('#nav a').click(function() {
var href = $.attr(this, 'href');
$root.animate({
scrollTop: $(href).offset().top
}, 500, function() {
window.location.hash = href;
});
return false;
});
</script>
<script>
// AJAX submit
$("#emailForm").submit(function() {
var url = "email.php";
$.ajax({
type: "POST",
url: url,
data: $("#emailForm").serialize(),
success: function(data)
{
$('#emailForm')[0].reset();
$('#contactForm').prepend('<h1 class="text-success" id="messageSent">Message sent!</h1>');
$("#messageSent").fadeIn("slow");
window.location.href = '#contact';
}
});
return false; // avoid to execute the actual submit of the form.
});
</script>
<!-- script to make the carousel work -->
<script>
// carousel demo
$('#myCarousel').carousel();
</script>
可能有人可能指出/解释我的方法错误
编辑:我使用的IE 8测试这
你得到任何错误?你可以将它们添加到你的问题? – naththedeveloper 2013-05-11 14:29:43
你指的是哪个版本的IE? – samayo 2013-05-11 14:30:29
我检查了Chrome中的控制台,没有错误/输出。 我还没有在IE中检查。你可能能解释如何做到这一点在IE作为即时通讯不知道如何做到这一点 – Will 2013-05-11 14:31:17