IE doesn't load external javascript files

S

steven.harms

I'm *sure* this has to be a FAQ and I see discussions of this in the
clj archives, but I don't see the answer. Perhaps someone here can
point the clueless, but...

1. I create an HTML document that validates at w3c

2. I use:

<script language="JavaScript" type="text/javascript"
src="dashboard.js" ></script>

3. <body onload="something_in_dashboard_js()">

4. In Firefox, it works beautifully ( no shock )
5. In IE it does not ( no shock )
6. If i put the function in inline <script> tags in my HTML, the JS
runs fine (no syntax error).
 
R

Randy Webb

(e-mail address removed) said the following on 8/21/2006 11:31 AM:
I'm *sure* this has to be a FAQ and I see discussions of this in the
clj archives, but I don't see the answer. Perhaps someone here can
point the clueless, but...

1. I create an HTML document that validates at w3c

The language attribute validates at w3c?
2. I use:

<script language="JavaScript" type="text/javascript"
src="dashboard.js" ></script>

3. <body onload="something_in_dashboard_js()">

4. In Firefox, it works beautifully ( no shock )
5. In IE it does not ( no shock )
6. If i put the function in inline <script> tags in my HTML, the JS
runs fine (no syntax error).

Post a URL to a sample page, complete, that shows the behavior.
 
S

steven.harms

Randy,

Upon taking your suggestion I moved the code to my web server ( instead
of the one on my corporate network ). You can view it at
'http://www.stevengharms.com/dash.html'.

The splash() code works just fine here (oddly enough) but the code
hasn't changed!

I'm even more baffled than I was before!

I just checked the page again to validate W3C validation, and it's
fine, so IB think the language attribute is still kosher in this DTD.

Steven
 
J

Jeremy

Randy,

Upon taking your suggestion I moved the code to my web server ( instead
of the one on my corporate network ). You can view it at
'http://www.stevengharms.com/dash.html'.

The splash() code works just fine here (oddly enough) but the code
hasn't changed!

I'm even more baffled than I was before!

I just checked the page again to validate W3C validation, and it's
fine, so IB think the language attribute is still kosher in this DTD.

Steven

Let me be the first to chastise you for top-posting ;-)

Perhaps the problem was an IE security-zone issue? If it works on the
new server and not the old, with no other changes (in file locations and
whatnot), I can't think of any other reason - except, perhaps, that the
old server was somehow mangling and / or mis-delivering your javascript
file.

Jeremy
 
S

steven.harms

I just checked the page again to validate W3C validation, and it's
Let me be the first to chastise you for top-posting ;-)

Perhaps the problem was an IE security-zone issue? If it works on the
new server and not the old, with no other changes (in file locations and
whatnot), I can't think of any other reason - except, perhaps, that the
old server was somehow mangling and / or mis-delivering your javascript
file.

An eagle-eyed developer friend noticed this, in my JSON hash statement
I had the line

something_block : {
"foo": "foot",
"bar" "bart",
}

Can you spot the error? That's right, that last comma creates the
message unhelpfully expressed by IE as "object expected".

Whew! Things are working now!

Steven
 
S

steven.harms

I found the error, for anyone searching the archives.

The issue was that in my JSON, I had left out a comma!

A great way to debug this was to put my JSON definition of a fairly
complex data structure at the END of the javascript file. After that I
could see that the functions were fine, it was just an error in my
declaration. Pretty basic stuff, but it's exactly that kind of thing
which'll getcha ;)

Steven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top