spacer
Yehuda Shiran April 11, 2002
A GUI for the IsPrime Web Service
Tips: April 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Here is the IsPrime Web service in action:

Enter a number:  

The isprime TABLE has two rows. The first row includes an entry field for the number to be tested and a button to invoke the check. The second row includes a DIV element that displays the answer, via an innerHTML update. The ID of the input field is testValue and the ID of the result DIV is theResult2. The button calls isPrimeNumber() when clicked. Here is the HTML code:

<TABLE BORDER="0">
  <TR>
    <TD>Enter a number:</TD>
    <TD><INPUT SIZE="4" TYPE="text" ID="testValue" VALUE="0"></TD>
    <TD>&nbsp;</TD>
    <TD><INPUT VALUE="Click here to check if prime" 
	 TYPE="button" onclick="isPrimeNumber();"></TD>
  </TR>
  <TR><TD COLSPAN=4><DIV ID="theResult2"></DIV></TD></TR>
</TABLE>
These Web service examples work properly in Internet Explorer 5.5 or later browsers. If you are using Internet Explorer 5.5+ and receiving errors with the examples, you need to enable the access data sources across domains option. See Column 105 for details.

To learn more on consuming multiple Web services, go to Column 106, Web services Part XI: Consuming Multiple Web Services.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint