|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
problem with wmlscript(i think)
Hi,
I am very new to wap programming and i am reading through Beginning WAP, WML & WMLScript by Wrox. One of the exercises is to implement a simple calculator function which adds together 2 integers keyed in by the user. The code below i know is right, because its supplied in the book. When te appliation is executed, it allows the user to type in 2 integers but when i press the calculate option i get an error. What i cant seen to do is get the WMLScript to work. I have added the following MIME types to IIS default web server: text/vnd.wap.wml application/vnd.wap.wmlc text/vnd.wap.wmlscript application/vnd.wap.wmlscriptc I thought by adding the above MIME types would solve my problem but it didn't. The two emulators i am using are Openwave SDK 6.2.2 and M3Gate. I really do not know whats wrong with it. Here is the code. calc.wml <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml_1.2.xml"> <wml> <card id="add" title="Add 2 Numbers"> <p>This is a simple calculator.</p> <p> Please enter the first number<br/> X = <input name="var1" title="1st number" format="*N" /><br/> Please enter the second number<br/> Y = <input name="var2" title="2nd number" format="*N" /><br/> <a href="calc.wmls#add($(var1), $(var2))">Calculator</a> </p> <do type="accept"> <go href="calc.wmls#add($(var1), $(var2))"/> </do> </card> <card id="answer" title="Result"> <p>X + Y = $(S)<br/></p> </card> </wml> and here is the code for calc.wmls extern function add(a, b) { WMLBrowser.setVar("S", a + b); WMLBrowser.go("#answer"); } I would very much appreciate any help. I cant really go through the rest of the book until i solve this problem. Thankyou solanki18 |
|
#2
|
|||
|
|||
|
The code worked correctly on my computer.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > problem with wmlscript(i think) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|