...

View Full Version : JavaScript error?



SteveH
05-30-2012, 04:07 PM
Hello

I am getting a 'Stack overflow at line: 94' error message from one particular Web site. It only seems to happen when I browse to one particular Web page. Is that likely to be a JS script error and how would I troubleshoot it, please?

Thanks

Steve

chrisf
05-30-2012, 05:10 PM
Which website?

SteveH
05-30-2012, 05:38 PM
Hello Chris

Thanks for your reply.

The site is here:

http://www.proofreading4students.com/default.asp

If you log in, the error message appears. There is also a yellow exclamation error in the bottom left hand corner which refers to this line:


// build selection box in the file 'message.asp'.

Thanks.

chrisf
05-30-2012, 05:41 PM
I just entered the chat with the username "Chris" and said hello. And everything has worked for me.

What browser are you using?

SteveH
05-30-2012, 06:42 PM
Hello Chris

I am using IE8. I have just tried it with Safari and it seems OK. Best to reinstall IE8 do you think?

Old Pedant
05-30-2012, 09:42 PM
I don't get the error with MSIE 9.



There is also a yellow exclamation error in the bottom left hand corner which refers to this line:

// build selection box

No, that is not true.

The line number you see in the error box is the line number in the HTML code, *NOT* in the ASP code.

To find which line it *really* refers to, you should use the MS Script Debugger or, if you want a quick answer, click on the VIEW menu and then on the SOURCE menu item. That will show you the HTML. Now find that line number in the HTML instead of the ASP code.

Old Pedant
05-30-2012, 09:43 PM
And I doubt that reloading MSIE 8 will fix anything. I'd bet it is something in your JS code that is not supported by MSIE 8 that is causing it. If you intend the page to work in all browsers, you need to track it down. See above.

SteveH
05-30-2012, 10:19 PM
Hello

I am still getting the 'stack overflow error' in IE8 (but not Chrome or Safari), but regarding the yellow exclamation mark, there are two errors:


Message: Syntax error
Line: 206
Char: 17
Code: 0
URI: http://www.proofreading4students.com/message.asp

Line 206 is this:
<p style="font-family: Verdana, Tahoma, Arial; font-size: 11px;">You are no longer logged on. Thank you for your
visit.</p>

and the second error is this:
Message: Object expected
Line: 217
Char: 1
Code: 0
URI: http://www.proofreading4students.com/message.asp

Line 217 refers to:
<body onload="init()" class=message>

I am not sure how accurate these 'errors' are, since they do not appear in Chrome or Safari.

Maybe it's best if I attempt to resolve the 'stack overflow error' first, and then go back to those two scripting errors (if they still occur).

Steve

Old Pedant
05-31-2012, 01:21 AM
MSIE IS RIGHT!!

*LOOK* at that code:


function onLoggedOff() {
<p style="font-family: Verdana, Tahoma, Arial; font-size: 11px;">You are no longer logged on. Thank you for your visit.</p>
parent.location.replace('default.asp');
}

YOU CAN NOT just dump HTML code smack in the middle of a JS function!

What in the world do you/did you think that was supposed to do?

And FF shows the same code. Why it doesn't report an error there is a mystery to me. It should.

SteveH
05-31-2012, 12:59 PM
Hello

I have managed to get rid of the 'stack overflow' error and the yellow exclamation mark, using the original
function onLoggedOff() {
alert('<%= getMsg("logout.no_longer_on") %>');
parent.location.replace('<%= LOGGED_OUT_PAGE %>');
}

Unfortunately, I have lost the font formatting that I had.

In IE8 I still have a yellow exclamation mark in the 'logout.asp' file:
if (opener.closed == false) { (but I don't get this in Safari), though in both browsers the control.asp file is showing
document.location.replace('expired.asp'); on screen.

Thanks for reading!

Old Pedant
05-31-2012, 11:11 PM
alert() does NOT allow any formatting. Period.

You would need to use a POPON <div> or similar to show formatted messages in the style of alerts. I suspect that is is something you aren't ready to attempt yet, so I'd leave it as an alert() until you get the other problems ironed out.

Yellow exclamation marks are fine, but they don't say *WHAT* the error is. Learn to use the developer tools in IE8 to find out what the actual error is.

And learn to use a JavaScript debugger on *ALL* the platforms you expect to support. It's the only reasonable way to figure out JS errors, really.

And remember: It doesn't matter what the ASP file shows. If it's a JavaScript error, you need to find and debug the error IN THE BROWSER. Looking at the HTML, not at the ASP code.

SteveH
06-01-2012, 12:37 AM
Hello Old Pedant

Thanks for that.


And remember: It doesn't matter what the ASP file shows. If it's a JavaScript error, you need to find and debug the error IN THE BROWSER. Looking at the HTML, not at the ASP code.

Yes, I have been doing that today: thanks again for the advice.

Steve



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum