|
July 15, 2002 Calling Web Services from JavaScript Tips: July 2002
Yehuda Shiran, Ph.D.
|
|
When you want to utilize your Web
services, put them (asmx
files) in a sub-directory of your Web server, such as c:\inetpub\wwwroot\Webreference.
Then, when you access the services in your scripts, you refer to their directory
as http://localhost/Webreference.
For each Web service you utilize you need to have three JavaScript functions:
For our
Similarly, for the IsPrime Web service, isPrimeNumber() is called when the Click here to check if prime button is clicked. It calls the Web service with three parameters: (i) the function to handle the result, isPrimeNumberResult, (ii) the Web service request, IsPrime, and (iii) the parameter expected by the Web service, testValue.value:
To learn more about JScript .NET, go to Column 112, JScript .NET, Part VI: Creating IE Web Services.
People who read this tip also read these tips: Look for similar tips by subject: |