Link to home
Start Free TrialLog in
Avatar of McKean
McKean

asked on

Javascript Compilation Error

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
Avatar of sybe
sybe

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).
 
ASKER CERTIFIED SOLUTION
Avatar of moorep
moorep

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?