473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.

Expand|Select|Wrap|Line Numbers
  1.             function testImage(URL)
  2.                 var tester=new Image();
  3.                 tester.onload=isGood;
  4.                 tester.onerror=isBad;
  5.                 tester.src=URL;
  6.             }
  7.  
  8.  
  9.             function isGood() {
  10.                 if( debug ) {
  11.                     alert('Image exists!');
  12.                     //Log success (around 20,000)
  13.                 }
  14.             }
  15.  
  16.             function isBad() {
  17.                 if( debug ) {
  18.                     alert('Image does no exist!');
  19.                     //Log failure (around 300)
  20.                 }
  21.             }

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Jun 30 '08 #1
1 931
Joshua Cranmer <Pi*******@verizon.invalidwrote in news:TT7ak.97$P11.65
@trndny06:
[ Sorry for top-posting ]
JavaScript != Java. Moving to c.l.js
!javaScript.equalsIgnoreCase(java)
Jun 30 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.