Solved

Javascript Compilation Error

Posted on 1997-05-05
3
207 Views
Last Modified: 2006-11-17
It's about my page at http://www.mjmsoft.com/ . It displays a mock-up
of the Win95 system tray generated using Javascript. [Because of
limitations of Netscape tables (problems with cell colours of a nested
table), it is best viewed using Internet Explorer.]

And here's the problem. I've tried viewing using successive updates of
MS IE3, and it always works fine for me.

But I get this report from a surfer:
"I've tried your web page from work again, here's the JScript errors I
get. I'm using NT4 SP2 with IE3.01a through a firewall.

1
Microsoft JScript compilation error
[Line: 35] Invalid character document.write ("<IMG
SRC="\"tdg/trayd"+thisDay+".gif\""ALT=\"Image of tray\"
ALIGN=\"MIDDLE\" WIDTH=\"109\" HEIGHT=\"20\">  ");
-----------------------------^

2
Microsoft JScript runtime error
[Line: 105] 'table1' is undefined

3.
Microsoft JScript runtime error
[Line: 142] 'caldar' is undefined

-----------------
It seems that the backslash is causing the problem, but it is the
correct way, I think, of generating a " with document.write.

It also seems wrong that Explorer quotes the line wrongly; it is
actually:
  document.write ("<IMG SRC=\"tdg/trayd"+thisDay+".gif\" ALT=\"Image
of tray\" ALIGN=\"MIDDLE\" WIDTH=\"109\" HEIGHT=\"20\">  ");
(Explorer puts in extra quote marks).

I'm concerned that people viewing my page may be getting errors which
are not generated for me.

Can anyone advise me on this?

Many thanks!
Martin
0
Comment
Question by:McKean
  • 2
3 Comments
 
LVL 28

Expert Comment

by:sybe
Comment Utility
No errors reported from: IE 3.02 NT4, no firewall

maybe it's the firewall ?? I've seen other strange errors with IE, like

parent.frames[2].history.go(0);

is ok for IE,  except when the visitor is a "testuser" in the network, meaning that this user has no other rights then any visitor from outside would have. Visitors from outside do sometimes have the same error.


parent.frames(2).history.go(0);

(the diference is using round brackets in stead of square)

is ok with all IE-visitors, but gives an error message in Netscape

Or maybe the user behind the firewall has an IE which is adapted, there are packages to build IE for e.g. intranet purposes. It offers possibilities to change some of the buttons and the IE-logo (i am not very sure what you can change, i just know that it exists).
 
0
 
LVL 1

Accepted Solution

by:
moorep earned 100 total points
Comment Utility
document.write ("<IMG                     SRC="\"tdg/trayd"+thisDay+".gif\""ALT=\"Image of tray\"
ALIGN=\"MIDDLE\" WIDTH=\"109\" HEIGHT=\"20\"> ");

should be
document.write ("<IMG                     SRC=\"tdg/trayd"+thisDay+".gif\""ALT=\"Image of tray\"
ALIGN=\"MIDDLE\" WIDTH=\"109\" HEIGHT=\"20\"> ");
you had one too many dowble quote marks.
0
 
LVL 1

Expert Comment

by:moorep
Comment Utility
Thanks moorep. Comments - it was the compiler report that added the extra quotation mark, which is not on my page which says: document.write ("<IMG SRC=\"tdg/trayd"+thisDay+".gif\" ALT=\"Image of tray\" ALIGN=\"MIDDLE\" WIDTH=\"109\" HEIGHT=\"20\"> ");
I had simply taken an HTML line, put \ before any quotation marks and turned it into a document.write line.
From your comment, is it correct that a single quote ' can be used in place of " to get round this?
The only other thing is - why have I only had one report of this error from a surfer - it works fine on my MSIE3.02 - why should it not work for all?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now