Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-30-2012, 04:07 PM   PM User | #1
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
JavaScript error?

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
SteveH is offline   Reply With Quote
Old 05-30-2012, 05:10 PM   PM User | #2
chrisf
New Coder

 
Join Date: Mar 2012
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
chrisf is an unknown quantity at this point
Which website?
chrisf is offline   Reply With Quote
Old 05-30-2012, 05:38 PM   PM User | #3
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
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:

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

Thanks.
SteveH is offline   Reply With Quote
Old 05-30-2012, 05:41 PM   PM User | #4
chrisf
New Coder

 
Join Date: Mar 2012
Posts: 15
Thanks: 0
Thanked 1 Time in 1 Post
chrisf is an unknown quantity at this point
I just entered the chat with the username "Chris" and said hello. And everything has worked for me.

What browser are you using?
chrisf is offline   Reply With Quote
Old 05-30-2012, 06:42 PM   PM User | #5
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
Hello Chris

I am using IE8. I have just tried it with Safari and it seems OK. Best to reinstall IE8 do you think?
SteveH is offline   Reply With Quote
Old 05-30-2012, 09:42 PM   PM User | #6
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,198
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
I don't get the error with MSIE 9.

Quote:
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.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Old 05-30-2012, 09:43 PM   PM User | #7
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,198
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Old 05-30-2012, 10:19 PM   PM User | #8
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
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:

Quote:
Message: Syntax error
Line: 206
Char: 17
Code: 0
URI: http://www.proofreading4students.com/message.asp
Line 206 is this:
Code:
<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:
Quote:
Message: Object expected
Line: 217
Char: 1
Code: 0
URI: http://www.proofreading4students.com/message.asp
Line 217 refers to:
Code:
<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
SteveH is offline   Reply With Quote
Old 05-31-2012, 01:21 AM   PM User | #9
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,198
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
MSIE IS RIGHT!!

*LOOK* at that code:
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.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Old 05-31-2012, 12:59 PM   PM User | #10
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
Hello

I have managed to get rid of the 'stack overflow' error and the yellow exclamation mark, using the original
Code:
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:
Code:
if (opener.closed == false) {
(but I don't get this in Safari), though in both browsers the control.asp file is showing
Code:
document.location.replace('expired.asp');
on screen.

Thanks for reading!
SteveH is offline   Reply With Quote
Old 05-31-2012, 11:11 PM   PM User | #11
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,198
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is online now   Reply With Quote
Old 06-01-2012, 12:37 AM   PM User | #12
SteveH
Regular Coder

 
Join Date: Nov 2005
Posts: 615
Thanks: 91
Thanked 1 Time in 1 Post
SteveH is an unknown quantity at this point
Hello Old Pedant

Thanks for that.

Quote:
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
SteveH is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:34 AM.


Advertisement
Log in to turn off these ads.