SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    loading prototype dynamically crashes IE6

    I've got an oddball problem:

    I'm working on content for a page, but I have no control over the headers of this page. My content basically starts well into the body of the document. The headers that I have no control over already load a version of Prototype, but its a really old one (1.4.0_pre11). My content requires some stuff that 1.4 doesn't support, so I want to load the latest version dynamically from within a script block. I've tried this 5 different ways so far but each one either doesn't work in IE6 (it throws a script error) or just crashes IE6 altogether. It works fine in FF3 though.

    Here's a link to the code, redacted as much as possible: http://gist.github.com/5135
    Chris Bloom
    Web Application Developer

  2. #2
    SitePoint Member RIAguy's Avatar
    Join Date
    Jul 2008
    Location
    Boston
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think what you're doing is a really bad idea, since you are most likely getting a namespace clash.

    Because prototype muddies the JavaScript global namespace I doubt that having two separate versions load will work as expected anywhere.


    RIAspot.com

    RIA Community

  3. #3
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps you're right, but I know when it does load (as in Firefox) and I query for Prototype.Version() I get the expected "1.6..." string. Similarly, if I don't load the newer script and query the version I get the old "1.4...: string. So, overriding is working, at least in Firefox....

    Maybe I can unload the original first? Maybe I can delete the original Prototype object???
    Chris Bloom
    Web Application Developer

  4. #4
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Instead of beating this thing to death for another 4 hours, I'm going to try to downgrade my code to use the older prototype library that is already being loaded. Still, it would be helpful to know if this *could* be done, for future reference...
    Chris Bloom
    Web Application Developer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •