SAPO::Utility.Url->getAnchor

This method will return the anchor of an URL By default it gets anchor of current URL. If an url is passed it will get anchor of passed URL.

This is static method.

Syntax

SAPO.Utility.Url.getAnchor(<optional string>)

Compatibility

All browsersYes

Depends

Input Parameters

  • <string> (optional)

Sample

 http://js.sapo.pt/SAPO/Utility/Url/sample/

Example

alert(SAPO.Utility.Url.getAnchor()); 
or 
alert(SAPO.Utility.Url.getAnchor('http://www.example.com/index.php#urlanchor')); 

Last example will return: 'urlanchor'
 

Community feedback

Error: Failed to load processor AddComment
No macro or processor named 'AddComment' found