spacer
Yehuda Shiran April 7, 2002
Consuming the Add Web Service
Tips: April 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Eclipse Helios Update Brings New PHP Tools
Internet Explorer 9 Ups Standards Support
JBoss Portal 5 Release Easier to Use

Here is the Add Web service in action:

Enter First Number:
Enter Second Number:

The add TABLE consists of four rows. You enter the first and second integers in the first and second rows, respectively, where we use INPUT fields. The third line is for putting a total ruler and a button to invoke the addition. The fourth line displays the result, by way of a DIV element: we update its innerHTML. Here is the add TABLE:

<TABLE BORDER="0">
  <TR><TD>Enter First Number:</TD><TD><INPUT SIZE="4" 
          TYPE="text" ID="first" STYLE="text-align:'right'"></TD></TR>
  <TR><TD>Enter Second Number:</TD><TD><INPUT SIZE="4" 
          TYPE="text" ID="second" STYLE="text-align:'right'"></TD></TR>
  <TR><TD align="right"><INPUT VALUE="Add" TYPE="button"
          onclick="addNumbers();"></TD><TD><HR></TD></TR>
  <TR><TD></TD><TD><DIV ID="theResult1" 
                    STYLE="text-align:'right'"></DIV></TD></TR>
</TABLE>
Notice the ID of the various fields. The ID of the first number field is first, the ID of the second number field is second, and the ID of the result DIV is theResult1. The Add button invokes the addNumbers() function when clicked.

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:

webref The latest from WebReference.com Browse >
Flashmaps' DynamicLocator: Interactive Maps for Small Areas · Flashmaps' AreaSelector: Interactive Maps for Wide Areas · The DB Mapper: Interactive Street-level Maps of U.S. and Canada
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags