开发者

Why is IE8 developer tool showing wrong line no for object expected error?

I am facing a strange javascript object expected error in IE8? On IE Developer tool the error shown as

Object expected  products.aspx?productid=127, line 234066871 character 5

There is only around 350 lines in the rendered html source. How to find the correct source of error.

Edit: There are following includes in the file.

<script type="text/javascript" src="/store/Scripts/jquery-1.3.2.min.js"></script>
<script type开发者_如何学C="text/javascript" src="/store/Scripts/jquery.imgareaselect.pack-0.9.1.js"></script>
<script type="text/javascript" src="/store/Scripts/thickbox.js"></script>
<script type="text/javascript" src="/store/Scripts/jquery.tooltip.pack.js"></script>
<script type="text/javascript" src="/store/Scripts/jquery.query-2.1.3.js"></script>
<script type="text/javascript" src="/store/Scripts/jquery.blockUI.js"></script>
<script type="text/javascript" src="/store/Scripts/jquery.tools.min.js"></script>

<script type="text/javascript" src="/store/Scripts/jquery.jcarousel.pack.js"></script>

And a call to Initialize.

<script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('Product1$ctl00$ScriptManager1', 'form1', ['Product1$ctl00$updatepanel01',''], [], [], 90, '');
//]]>
</script>


Edit -

@Glycerine: I have added some source code which I think is called at the time of PageLoad.

Can you see why this happens? I bet if you count the lines in each of your libs... You'll reach that random number.

if you code does not rely on these libs, place your lines of code before these script tags. and your line number will change to something more realistic...

Again. When JS counts lines to the error occurrence, its not just the one file its looking at.


Totally need more dude. But uber guess would be:

The function called has an optional object you send to it as an argument. Leaving this empty on other browsers is OK, but IE can be strict.

Ensure if your calling the function and it requires an arugment - if you intend not to send anything to it send a null/empty/0 value ANYHTING you want you can check against to make sure you dont want it. This MAY fix whatever problem you have. Or maybe not. Or maybe your IE could be broken - or you havent added your javascript. Anything could be happening... Send us some source?


My theory is that one of your script tags is dependent on another one. Try examining the dependencies of each script and see if you need to reorder the script tags.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜