Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > IE doesn't load external javascript files

Reply
Thread Tools

IE doesn't load external javascript files

 
 
steven.harms@gmail.com
Guest
Posts: n/a
 
      08-21-2006
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).

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      08-21-2006
http://www.velocityreviews.com/forums/(E-Mail 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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
 
Reply With Quote
 
 
 
 
steven.harms@gmail.com
Guest
Posts: n/a
 
      08-21-2006
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



Randy Webb wrote:
> (E-Mail 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.
>
> --
> Randy
> comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
> Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


 
Reply With Quote
 
Jeremy
Guest
Posts: n/a
 
      08-21-2006
(E-Mail Removed) wrote:
> 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
 
Reply With Quote
 
steven.harms@gmail.com
Guest
Posts: n/a
 
      08-21-2006
> > 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.


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

 
Reply With Quote
 
steven.harms@gmail.com
Guest
Posts: n/a
 
      08-24-2006
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

(E-Mail Removed) wrote:
> > > 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.

>
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Javascript function upon Page Load from Page Load event handle Matcon ASP .Net 3 05-28-2008 05:15 PM
Javascript load external URL's? ReGenesis0@aol.com Javascript 4 05-18-2006 09:00 AM
Load data from external files jeet_sen Javascript 6 03-08-2006 06:52 PM
Load external JS using Javascript... howachen@gmail.com Javascript 4 02-20-2006 03:29 PM
Create references to external scipt files from within an external script file Mellow Crow Javascript 6 11-04-2005 01:16 PM



Advertisments