2011-05-31 47 views
1

我目前正试图调试一些奇怪的错误,只发生在IE7中。调试IE7 ajax加载javascript

IE所支持的错误指向一个空行或某一行1。我认为一些错误可能发生在由AJAX加载的页面上。 第一个错误是:

Line: 1 
Character: 181 
Code: 0 
Error Message: 'null' is null or not an object 
URL: http://192.168.1.103/repositories/asdasd/public_html/admin/module/admin/News/Mod?id=23 

页面的源代码是:

<script type="text/javascript"> 

//Prendre en charge la soumission des formulaire. Les traiter en AJAX par défaut. 
$("#form_add-image").bind("submit", function(){ 

    $.ajax({ 
     url: $("#form_add-image").attr("action"), 
     type: $("#form_add-image").attr("method"), 
     data: $("#form_add-image").serialize(), 
     dataType: 'html', 
     success: function(data, textStatus, XMLHttpRequest){ 

      //Remplacer le contenu 
      manualLightboxContent(data, {'width': 1000, 'zIndex': 500000}, "#dialog_imagesZone"); 
     } 
    }); 

    return false; 
}); 
</script> 
<div id="main" class="s_formulaires outlined"> 
<form id="form_add-image" action="/repositories/asdasd/public_html/admin/moduleAJAX/admin/Media/chain-execute/add-image" method="post"> 
    <script type="text/javascript"> 
$(document).ready(function(){ 
    $('#crop_box').Jcrop({ 
     setSelect: [ 1380, 0, 1080, 1080], 
     aspectRatio: 1, 
     bgOpacity: 0.5, 
     boxWidth: 640, 
     boxHeight: 480, 
     onChange: showCoords, 
     onSelect: showCoords 
    }); 

    $('#crop_button').button(); 

    function showCoords(c){ 
     $('#crop_left').val(c.x); 
     $('#crop_top').val(c.y); 
     $('#crop_right').val(c.x2); 
     $('#crop_bottom').val(c.y2); 
     $('#crop_width').val(c.w); 
     $('#crop_height').val(c.h); 
    }; 
}); 
</script> 

<h2>Recadrer l'image</h2> 
<div style="margin:10px;"> 
<img src="http://192.168.1.103/repositories/asdasd/public_html/media/module_news/files/23-226-Capture-2.png" id="crop_box" /> 
</div> 
Déplacez la sélection pour choisir la zone à conserver<br /><br /> 

<div style="display:none;"> 
<label>left <input type="text" name="crop_left" id="crop_left" size="4"></label> 
<label>top <input type="text" name="crop_top" id="crop_top" size="4"></label> 
<label>right <input type="text" name="crop_right" id="crop_right" size="4"></label> 
<label>bottom <input type="text" name="crop_bottom" id="crop_bottom" size="4"></label> 
<label>width <input type="text" name="crop_width" id="crop_width" size="4"></label> 
<label>height <input type="text" name="crop_height" id="crop_height" size="4"></label> 
</div> 

<button id="crop_button">Accepter la sélection</button> 
    </form> 
</div> 

的页面是一个灯箱,所以它使用从主网页加载脚本。 (在这种情况下:JQuery & JCrop)

你有一个想法来帮助我调试这...因为错误不是很详细。

+1

下载IE8,有一个IE7模式。您可以使用浏览器中的调试器来调试问题。 – epascarello 2011-05-31 15:57:02

+0

这就是我们现在正在做的。但是这个错误似乎存在于__flash__addCallback方法中,即浏览器的内部JS方法。我试图找出找到导致这一点的执行路径的方法。 – FMaz008 2011-05-31 17:19:24

+0

我刚刚找到了对特定错误的回答(在以下链接中),并发布了一个解决方案。但是,我仍然希望在IE中有更多的详细信息! http://passion4code.com/2010/12/10/jquery-ie-and-__flash__addcallback/#comment-388 是的,它与我发布的例子无关......我会搜索一个长时间... – FMaz008 2011-05-31 17:59:31

回答