Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Javascript Compilation Error

Posted on 1997-05-05
3
Medium Priority
?
216 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
ID: 1265395
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 200 total points
ID: 1265396
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
ID: 1265397
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

886 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