Version 0.4
jUri.ajax( url )
jUri.ajax( data )
url The url to load, the function will return the xmlhttpRequest method
data A map of these properties:
jUri.anchorExists( name [, callback] )
name A string to search an anchor like
callback A function to be executed if the anchor exists (the anchor is passed as argument of the function)
jUri.animateAnchorLinks( )
jUri.animateAnchorLinks( [anchors] [, changehash] )
This function set an animate scrolling when a link like Bar is clicked (an there is an anchor like )
anchors The anchor name's to be animated, separated by ','. The string can be '*' to animate all the anchors
changehash A boolean, if true, the hash is changed after each scroll
jUri.back( [int][, fallback] )
Calls window.history.back()
int Number of pages to go back in the history
fallback A function to execute if it fails
jUri.get( )
jUri.get( str )
Returns a map of the GET vars in the current url. If str is passed as an argument, .get() tries to convert it in a map
str A string like '?foo=bar&b=f'
jUri.hash( )//returns the current hash
jUri.hash( newhash )//set a new hash
jUri.hash( regexp [, callback] )//match the current hash with the regexp, returns true/false. If true, execute the callback
newhash A string with the new hash
regexp A regular expresion to be matched with the current hash
callback A function to be executed if the hash matches with the regexp
jUri.hashchange( callback )
callback A function to be executed when the hash changes
jUri.host( )
Returns window.location.host
jUri.hostname( )
Returns window.location.hostname
jUri.href( )
Returns window.location.href
jUri.isFile( [callback] )
This function checks if the current url is a file-url (but doesn't check if the file exists)
callback A function to be executed if the url is a file-url
jUri.isHTTP( )
Returns true/false when the current protocol is http://
jUri.isHTTPS( )
Returns true/false when the current protocol is https://
jUri.parseAsGet( getstring )
getstring A string like '?foo=bar&b=f'
Returns a map of the vars passed in the string
jUri.pathname( )
Returns window.location.pathname
jUri.host( )
Returns window.location.port
jUri.protocol( )
Returns window.location.protocol
jUri.redirect( url [, timeout] )
url The url to redirect to
timeout An integer in miliseconds to redirect after that time
jUri.redirect( [timeout] )
timeout An integer in miliseconds to reload after that time
jUri.set( url [, fallback] )
jUri.set( object [, fallback][, newState] )
jUri.set( object [, fallback][, forceUrlChangeEvent][, newState] )
url A string with the url to set
fallback A function to be executed if the browser doesn't support url changes
object A map of these three properties:
jUri.title( title )
jUri.title( array[, ms] )
//It returns always a .stop() method, check tester.html to see its use
title A string with the new window title
array An set of titles to change to periodically
ms An integer in miliseconds to set the period of title changing
jUri.urlchange( callback[, fireOnHashChange][, fireOnJUriSet] )
callback A function to be executed when the url changes
fireOnHashChange A bool, false by default
fireOnJUriSet A bool, false by default. The event will not fire if the url is changed using jUri.set('')