IE doesn't load external javascript files

Discussion in 'Javascript' started by steven.harms@gmail.com, Aug 21, 2006.

  1. Guest

    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).
    , Aug 21, 2006
    #1
    1. Advertising

  2. Randy Webb Guest

    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/
    Randy Webb, Aug 21, 2006
    #2
    1. Advertising

  3. Guest

    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:
    > 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/
    , Aug 21, 2006
    #3
  4. Jeremy Guest

    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
    Jeremy, Aug 21, 2006
    #4
  5. Guest

    > > 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
    , Aug 21, 2006
    #5
  6. Guest

    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

    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
    , Aug 24, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matcon
    Replies:
    3
    Views:
    21,572
    Matcon
    May 28, 2008
  2. Mellow Crow
    Replies:
    6
    Views:
    418
    Richard Cornford
    Nov 4, 2005
  3. Replies:
    4
    Views:
    87
    Richard Cornford
    Feb 20, 2006
  4. jeet_sen

    Load data from external files

    jeet_sen, Mar 8, 2006, in forum: Javascript
    Replies:
    6
    Views:
    124
    Thomas 'PointedEars' Lahn
    Mar 8, 2006
  5. Replies:
    4
    Views:
    211
    Erwin Moller
    May 18, 2006
Loading...

Share This Page