Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IE中的Javascript错误_Javascript_Jquery - Fatal编程技术网

IE中的Javascript错误

IE中的Javascript错误,javascript,jquery,Javascript,Jquery,请帮我纠正javascript中的错误,它在IE中不起作用,我不明白这里的问题是什么: $(document).ready(function() { $(".image2").click(function() {var image = $(this).attr("rel"); $('#image2').hide(); $('#image2').fadeIn('slow'); $('#image2').html('<emb

请帮我纠正javascript中的错误,它在IE中不起作用,我不明白这里的问题是什么:

   $(document).ready(function() {
        $(".image2").click(function() {var image = $(this).attr("rel");
        $('#image2').hide();
        $('#image2').fadeIn('slow');
        $('#image2').html('<embed height="253" width="440" wmode="transparent" src="' + image + '"></embed>');
        var image2 = $('#image2 embed').attr('src');
        $("#thumb2 a img").removeClass("open");
        $("#thumb2 a[rel='" + image2 + "'] img").addClass("open");
        return false;
        });
    });
    $(document).ready(function() {  
        var image3 = $('#image2 embed').attr('src');
        $("#thumb2 a[rel='" + image3 + "'] img").addClass("open");

        var n = $('#news_list');    
        n.find('.list_news a').css({opacity: 0.5}).hover(
            function() { $(this).css({opacity: 1}); },
            function() { $(this).css({opacity: 0.7}); }
        );
        n.hover(
            function() { $(this).find('a').css({opacity: 0.7}); },
            function() { $(this).find('a').css({opacity: 0.5}); }
        );
    });

    $(document).ready(function() {  
        $('.image').click(function(event) {
        event.preventDefault();
        var imagePath = $(this).attr("href");
        var newImg = new Image;
        newImg.src = imagePath;
        newImg.onload = function(){
            $('#big_picture').hide();
            $('#big_picture').attr('src', imagePath);
            $('#big_picture').fadeIn('slow');
        };
        });
    });

    $(document).ready(function() {  
        $(".dropdown a").each(function() {
        if(this.href == window.location) 
        $(this).addClass("open");
        });

        $('.slider_fade').cycle({ 
        fx:     'fade',
        timeout: 7000,
        });
    });
    $('.upper_menu_link').attr('target', '_blank');

    var message="";
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if 
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2) {
    (message);
    return false;}}}
    if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickNS;
    }else{
    document.onmouseup=clickNS;
    document.oncontextmenu=clickIE;
    }
    document.oncontextmenu=new Function("return false");

        $('.urun_div').corner("round 20px");
$(文档).ready(函数(){
$(.image2”)。单击(函数(){var image=$(this.attr(“rel”);
$('#image2').hide();
$('#image2').fadeIn('slow');
$('#image2').html('');
var image2=$('#image2-embed').attr('src');
$(“#thumb2 a img”).removeClass(“打开”);
$(“#thumb2a[rel='”+image2+“']img”).addClass(“打开”);
返回false;
});
});
$(文档).ready(函数(){
var image3=$('#image2-embed').attr('src');
$(“#thumb2a[rel='”+image3+“']img”).addClass(“打开”);
var n=$(“#新闻列表”);
n、 查找('.list_news a').css({opacity:0.5})。悬停(
函数(){$(this.css({opacity:1});},
function(){$(this.css({opacity:0.7});}
);
n、 盘旋(
函数(){$(this.find('a').css({opacity:0.7});},
函数(){$(this.find('a').css({opacity:0.5});}
);
});
$(文档).ready(函数(){
$('.image')。单击(函数(事件){
event.preventDefault();
var imagePath=$(this.attr(“href”);
var newImg=新图像;
newImg.src=图像路径;
newImg.onload=函数(){
$(“#大图”).hide();
$('big#picture').attr('src',imagePath);
$('big#picture')。fadeIn('slow');
};
});
});
$(文档).ready(函数(){
$(“.dropdown a”).each(function(){
if(this.href==window.location)
$(此).addClass(“打开”);
});
$('.slider_fade')。循环({
外汇:“淡出”,
超时:7000,
});
});
$('.upper_menu_link').attr('target','u blank');
var message=“”;
函数clickIE(){if(document.all){(message);返回false;}}
函数clickNS(e){if
(document.layers | |(document.getElementById&&!document.all)){
如果(e.which==2){
(信息);
返回false;}}}
if(document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS;
}否则{
document.onmouseup=clickNS;
document.oncontextmenu=clickIE;
}
document.oncontextmenu=新函数(“返回false”);
$('.urun_div')。拐角(“圆形20px”);

最新版本的Internet Explorer附带了一套开发工具(通过按F12键访问),如果您使用这些工具,它们将告诉您发生错误的行号、错误类型(语法、NaN、未定义等).

最新版本的Internet Explorer附带了一套开发工具(通过按F12键访问),如果您使用这些工具,它们将告诉您发生错误的行号、错误类型(语法、NaN、未定义等)。

问题出在
超时后的逗号:7000

更多信息

有时,每当我的代码在IE中失败但在其他浏览器中工作时,我会使用类似于上一个链接中的正则表达式来搜索我的代码


另外,对于像这样的错误,这个函数也有很大的帮助。

超时后的逗号:7000是个问题

更多信息

有时,每当我的代码在IE中失败但在其他浏览器中工作时,我会使用类似于上一个链接中的正则表达式来搜索我的代码


此外,对于像这样的错误,这可能会有很大的帮助。

请澄清一下“不起作用”好吗。什么不起作用?您收到了什么错误消息?在
超时后额外添加了逗号:7000
??@Marko极好的位置--我确信这就是原因。@Marko Dumic:没错!超时后多加逗号)谢谢@老兄,你的代码看起来很乱。。。
.ready()。。可能是一个在线的例子,比如演示你的问题,帮助社区解决这个问题。祝您今天过得愉快!请你澄清一下“不起作用”好吗。什么不起作用?您收到了什么错误消息?在
超时后额外添加了逗号:7000
??@Marko极好的位置--我确信这就是原因。@Marko Dumic:没错!超时后多加逗号)谢谢@老兄,你的代码看起来很乱。。。
.ready()。。可能是一个在线的例子,比如演示你的问题,帮助社区解决这个问题。祝您今天过得愉快!