|
Newsletters
|
|
|
|
|
WMLScript Reference
WMLScript Reference
WMLScript > URL > loadString()
loadString() - The loadString Function
Usage: loadString(url, contentType)
Description: Returns the content denoted by the given absolute url and the content type.
The given content type is erroneous if it does not follow the following rules:
- Only one content type can be specified. The whole string must match with only one content type and no extra leading or trailing spaces are allowed.
- The type must be text but the subtype can be anything. Thus, the type prefix must be "text/".
The behavior of this function is the following:
- The content with the given content type and url is loaded. The rest of the attributes needed for the content load are specified by the default settings of the user agent.
- If the load is successful and the returned content type matches the given content type then the content is converted to a string and returned.
- If the load is unsuccessful or the returned content is of wrong content type then a scheme specific error code is returned.
Example:var myUrl = "http://www.host.com/vcards/myaddr.vcf";
myCard = URL.loadString(myUrl, "text/x-vcard");
Bookmark this page
|
|