|
Newsletters
|
|
|
|
|
WMLScript Reference
WMLScript Reference
WMLScript > URL > resolve()
resolve() - The resolve Function
Usage: resolve(baseUrl, embeddedUrl)
Description: Returns an absolute URL from the given baseUrl and the embeddedUrl according to the rules specified in [RFC2396]. Before executing the rules specified in [RFC2396] the baseUrl is checked. If the baseUrl's path component is an empty string, then a single slash character ("/") is assumed as the path. If the embeddedUrl is already an absolute URL, the function returns it without modification.
Example:var a = URL.resolve("http://foo.com/","foo.vcf");
// a = "http://foo.com/foo.vcf"
var b = URL.resolve("http://foo.com","c");
// b = "http://foo.com/c"
var c = URL.resolve("http://foo.com","/c");
// c = "http://foo.com/c"
var d = URL.resolve("http://foo.com","?q");
// d = "http://foo.com/?d"
var e = URL.resolve("http://","x");
// e = "http:///x"
Bookmark this page
|
|