Re: Question on JavaScript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joshua Cranmer

    Re: Question on JavaScript

    [ Sorry for top-posting ]
    JavaScript != Java. Moving to c.l.js
    Dorothy Mantooth wrote:
    My company is switching from using a vendor DNS server to our own as
    well as creating a new network. We want to verify whether or not our
    customers can "reach" our new network so we have placed some
    JavaScript on the logon page of one of our applications to check for
    the existence of an image on the new network. We have had over 20,000
    successes and about 300 failures. I want to know if the failures
    could be do to the following scripting code or if we should continue
    to look at the DNS, ACL's, etc. I want to rule out the script. The
    failures are falling into the isBad funciton and we are logging.

    Code:
    			function testImage(URL)
    				var tester=new Image();
    				tester.onload=isGood;
    				tester.onerror=isBad;
    				tester.src=URL;
    			}
    
    
    			function isGood() {
    				if( debug ) {
    					alert('Image exists!');
    					//Log success (around 20,000)
    				}
    			}
    
    			function isBad() {
    				if( debug ) {
    					alert('Image does no exist!');
    					//Log failure (around 300)
    				}
    			}

    --
    Beware of bugs in the above code; I have only proved it correct, not
    tried it. -- Donald E. Knuth
  • Donkey Hot

    #2
    Re: Question on JavaScript

    Joshua Cranmer <Pidgeot18@veri zon.invalidwrot e in news:TT7ak.97$P 11.65
    @trndny06:
    [ Sorry for top-posting ]
    JavaScript != Java. Moving to c.l.js
    !javaScript.equ alsIgnoreCase(j ava)

    Comment

    Working...