WMLScript URL Standard Library

In
the following sections, we will look at some of the more commonly
used functions in the URL standard library.

Getting the Current
WMLScript Document's URL: getBase() Function

The
getBase()
function of the URL standard library is used to get the current WMLScript document's URL without
the fragment part (the fragment of a URL is the part that begins with
the # character). Note that the URL returned is always in the
absolute form.

The
following WML/WMLScript example demonstrates the use of the getBase()
function. Let's say we have a WML document that contains the markup
below:

If
we open the WML card in a WAP browser and select the "Run
WMLScript" anchor link, the func1()
function in the WMLScript file tutorial_eg.wmls will be
executed. Below shows the script included in the tutorial_eg.wmls
file:

extern
function func1(){ var url_str = URL.getBase();}

func1()
contains only a single line of statement. After the statement is
executed, the url_str
variable has the string value
"http://www.developershome.com/examples/wmlscript/tutorial_eg.wmls?x=abc&y=123".
(Suppose the tutorial_eg.wmls
file is stored in the directory "examples/wmlscript/" of
the host "www.developershome.com".)

We
can further extract the query string in the url_str variable
using the getQuery()
function, which will be covered in this tutorial later.

What do you think about this web page? It is very helpful. It is helpful, but some information I wanted is missing. It is not helpful. It has broken links. It has typos / grammatical mistakes. It has incorrect information. Others

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Due to the amount of messages we received, we may not be able to reply to all messages.