| Version 1 (modified by tiago.c.rodrigues, 3 years ago) |
|---|
[Elements] are optional
Class SAPO.Utility.Url
class
SAPO.Utility.Url
utilities to manipulate Url's
Defined in
Utility/Url/0.1/lib.jsInclusion link: http://js.sapo.pt/SAPO/Utility/Url/0.1/
Sample: http://js.sapo.pt/SAPO/Utility/Url/sample/
Function Summary
Decode a BASE 64 encoded string
Convert a string to BASE 64
Object
currentScriptElement()
Get last loaded script element
Should be called when the script file is loaded
Get anchor string of current or passed URL
Get query string of current or passed URL
Function Details
function base64Decode
Decode a BASE 64 encoded string
Parameters:
string
base64 encoded string
Returns:
string decoded
function base64Encode
Convert a string to BASE 64
Parameters:
string
- string to convert
Returns:
base64 encoded string
function currentScriptElement
Object
currentScriptElement()
Get last loaded script element
Should be called when the script file is loaded
Returns:
Script Element
function getAnchor
Get URL anchor
Parameters:
[string]
URL string
Returns:
URL anchor
function getAnchorString
Object
getAnchorString([String
string])
Get anchor string of current or passed URL
Parameters:
[string]
- URL string
Returns:
Object with pairs variable => value of each URL variables
function getQueryString
Object
getQueryString([String
string])
Get query string of current or passed URL
Parameters:
[string]
- URL string
Returns:
Object with pairs variable => value of each URL variables
function getUrl
String
getUrl()
Get current URL of page
Returns:
current URL
function parseUrl
Object
parseUrl(String
string)
Parse passed URL
Example for URL: http://www.sapo.pt/index.html?var1=value1#anchor
Object = {
'scheme' => 'http',
'host' => 'www.sapo.pt',
'path' => '/index.html',
'query' => 'var1&value1',
'fragment' => 'anchor'
}
Parameters:
string
URL string
Returns:
an object with URL structure