WMLScript
WMLScript is a procedural programming language and dialect of JavaScript used for WML pages that is part of the Wireless Application Protocol (WAP), and was published on April 30, 1998.[1]
WMLScript is a client-side scripting language and is similar to JavaScript. Similarly to JavaScript, WMLScript is used for tasks such as user input validation, generation of error messages, and other dialog boxes.
WMLScript is based on ECMAScript (European Computer Manufacturers Association Script), which is JavaScript's standardized version. Thus, the syntax of WMLScript is similar to JavaScript, but not fully compatible.[2] WMLScript does not have objects or arrays like Javascript does. It does allow the programmer to declare and include external functions from other scripts. WMLScript is optimized for low power consumption and is compiled with bytecode.
Some versions of WMLScript include 1.0, which was the launch version from April 30, 1998. 1.1, which released on June 16th, 1999 and brought some minor enhancements. 1.2 was released in June 2000, but is less documented and lacks a more specific publication date. On Oct 25, 2001, a consolidated version of WMLScript was released, and unified all versions, this was not a new version, it only standardized formatting and unified the specification. Additionally a less standardized and disputed 1.3 version that was not officially released by OMA, but appears in some third party sources, and was never standardized by OMA. [1]
WMLScript code
WMLScript needs to be called by a WML <a> or <do> element to run inside the document you want it to because it lacks features on page load features that languages like JavaScript have.[3]
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="WMLScript">
<p>
<a href="helloWorld.wmls#helloWorld()">Run WMLScript</a><br/> <!-- Runs the script-->
$(message)
</p>
</card>
</wml>
And the contents of that .wmls document are:[3]
extern function helloWorld()
{
WMLBrowser.setVar("message", "Hello World."); //Sets variable "message" to "Hello World."
WMLBrowser.refresh(); // Refreshes the WML document to display the new message
}
References
- ^ a b "WMLScript Specification" (PDF). Open Mobile Alliance. Archived (PDF) from the original on 2025-07-25. Retrieved 2025-12-11.
- ^ "WMLScript Primer: JavaScript vs. WMLScript | WebReference". Archived from the original on December 9, 2016. Retrieved June 2, 2011.
- ^ a b "WMLScript Tutorial - Learn WML Script with the Help of Examples". www.developershome.com. Retrieved 2025-12-12.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.