#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    9
    Rep Power
    0

    IE 5.5 vs Netscape 4.7 & Javascript


    why is my Javascript so slow on IE 5.5?? same script is 40 times faster in Netscape 4.7!!

    I've got an application that uses Javascript to run temporary totals on alot of form input data (I mean alot -- at least 5000 input fields) the same totaling Javascript will take 40 seconds when using IE 5.5 SP2 -- but only takes 1 second in Netscape 4.7

    I like IE cause it offers many more programming options for me, also, on the initial load of the 5000 inputs it is way faster than Netscape -- so I'm in a catch22 it's faster on the load, but slower with the Javascript

    Any insight or help would be greatly appreciated!
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    24
    Well one thing, and I'm beginning to sound like a stuck record here) is that IE doesn't run JavaScript, it runs Jscript. They are not the same! When IE encounters a javascript script tag then it tries to guess the Jscript equivalent. What this means is that Jscript is very good at overcoming errors (I'm sure you've noticed) as it is guessing all the time. Second is that it can't tell you what the rrors are as well as Netscape (again I'm sure you've noticed). And finally, for long javascript it should take longer because it is having to translate, a 5000 time for loop means 5000 translations of the code enclosed in it.

    On the plus side, Netscape crashes all the time, renders appallingly slow, and 4.7 is sooo out of date!
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    9
    Rep Power
    0

    jscript


    OK, so is there no way around it? can I tell it not to translate? or am I stuck with it?
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    9
    Rep Power
    0
    let me add that this is an intranet application and I can have all my users configured the same way. I can program knowing that everyone will be using either netscape or ie. in light of that, what would you suggest?
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    9
    Rep Power
    0
    thanks for the input -- all help is appreciated

    so I did a little research on JScript vs Javascript and went ahead and changed my script tag for langauge="JScript" -- ran it again in IE 5.5 -- and what happened? -- nothing much, it still takes it 40 (ugly) seconds to compute. So I'm still looking for a better solution... any more ideas??
  10. #6
  11. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    24
    Well you can specify the language type in the <script> tags as Jscript. But then Netscape won't do it. You can have ASP or PHP do the switch in the tag type though I suppose.

    It's surprising that IE is 40 times as slow as NS. It's normally about 5% slower. So should take 1.2 seconds to NSs 1. Something very strange. Possibly not to do with IE at all, so to speak. Have you tried reinstalling the browser, switching off other apps?

IMN logo majestic logo threadwatch logo seochat tools logo