| Author |
how reliable is javascript?
|
chetak faldesai
Greenhorn
Joined: Jun 11, 2003
Posts: 27
|
|
Hi, I am just wondering how reliable javascript is? Like i had some javascript code displaying a image on a click of a button and changing to another image on clicking the same button. but it works most of the times but sometimes the image just does not show up and if i refresh it it shows up again as if nothing was wrong. Also can javascript behave differently on different machines? Chet
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15003
|
|
Here is how reliable JavaScript is Tools --> Internet Options --> Security --> Custom Level --> Disable Scripting Now nothing will work! The image not loading can be as simple as the browser got tired of wating for it and said forget it. If a person does not code the pge correctly then it will have problems from browser to browser. document.all is a commmon reason why stuff does not work. Read this blog entry of mine.... http://radio.javaranch.com/channel/pascarello/2004/03/31.html Eric
|
 |
chetak faldesai
Greenhorn
Joined: Jun 11, 2003
Posts: 27
|
|
Thanks for the reply Eric. What I meant was, other then the browser dependencies, are there other factors in which _javascript can behave wierd . With other factors i mean lets say memory problem, or if its running in a web server/appserver environment any settings there which could be a cause for the _javascript code behaving wierdly? Thanks, Chet
|
 |
Yuriy Fuksenko
Ranch Hand
Joined: Feb 02, 2001
Posts: 411
|
|
Well, for example, IE on my computer crashes, if web page size is more than 10 Gb. One weirdest thing about javascript - everything on the page hangs, while your script working - so I had to use setIntervals or setTimeout instead of direct "for" loop in last project.
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15003
|
|
As Yuriy says, A for loop that runs about 1000 times will hang browsers, If you run out of memory the page will crash... There is no settings other then looking to optimize code...
One weirdest thing about javascript - everything on the page hangs, while your script working - so I had to use setIntervals or setTimeout instead of direct "for" loop in last project.
I had to do that for some of my AI game scripts.... Eric
|
 |
 |
|
|
subject: how reliable is javascript?
|
|
|