tags:

views:

406

answers:

3

Hello,

Can someone figure out what this Line 1 Syntax error is? I am trying to debug in IE6 and IE7 and can't find the source of the issue.

http://ci.elfster.net/apps/game/tree/design.aspx

Thanks

A: 

Try plugging your javascript code into http://jslint.com - I've found that fixes most problems with my code breaking weirdly in IE.

Also, for future reference, you might want to try adding a bit more explanation to your question - simply posting a link is making it harder for people to help you, and most people won't actually visit the site and try to look at your code (I didn't).

inkedmn
My apologies. Thanks for the tip, still new to hacking
Adrian Adkison
A: 

This line is the one that's giving IE a hard time:

document.getElementById('_ornamentSelectorsLeft').onclick = scrollPicsLeft;

Does the function scrollPicsLeft mean anything to you (hint: it should..)

My guess is that error is actually in a different location (probably somewhere in the code before where you define the scrollPicsLeft function) and IE is failing to parse the code for scrollPicsLeft which is why it says that it can't find it later when you're trying to use it.

You may wish to enable debugging JavaScript in IE and use Visual Studio to find out where IE hangs.. (that's how I found your error)

Miky Dinescu
Thanks for your help! I think DmitryK nailed it.
Adrian Adkison
+5  A: 

Just after this comment line:

<!-- Begin -  Site: Elfster.com Zone: 2008 Master Template Leaderboard -->

you are trying to embed a javascript:

var src = 'http://ads.elfster.com/go/a.aspx?ZoneID=' + ZoneID + '&amp;Task=Get&amp;IFR=False&amp;PageID=27668&amp;SiteID=' + SiteID + '&amp;Random=' + browDateTime;

I've got this path:

a.aspx?ZoneID=4&Task=Get&IFR=False&PageID=27668&SiteID=1&Random=1250553113754

This URL returns HTML not javascript hence the error you get.

DmitryK
DmitryK
awesome this is exactly what I needed. One further question, if this is the case, how come I don't receive an error in firefox?
Adrian Adkison
Because FF generates a different URL:http://ads.elfster.com/go/a.aspx?ZoneID=4
DmitryK
The difference is that extra parameter: browser=NETSCAPE4
DmitryK
Got it, thanks!
Adrian Adkison