Small library for handling url hash parameters on single page applications
ParamManager Class that lets you manage pseudo parameters using a fake path on the hash
Check if a single parameter exist NOTE: returns true even if does not have a value ("" or undefined)
Parameters
key: String
, name of the parameter
Returns: Boolean
, true if parameter exist
Get a single parameter
Parameters
key: String/Number/Array/Boolean
, Parameter name
Returns: String
, [description]
Set a single parameter
Parameters
key: String
, Parameter name
val: String/Number/Array/Boolean
, Value of the parameter
Get a single parameter that contains an array
Parameters
key: String
, Parameter name
Returns: Array
, [description]
Set a single parameter with an array
Parameters
key: String
, Parameter name
val: Array
, Values of the parameter
Remove a single parameter
Parameters
key: String
, The key of the parameter to be removed
val: String
, The value of the object removed or undefined
Get all parameters specified on the URL
Returns: Object
, Object containing keys and values from the url parameters
Set all parameters on the url from a object
Parameters
obj: Object
, An object containing keys and values
Set multiple parameters on the url from a object and keep other values unaltered
Parameters
obj: Object
, An object containing keys and values to be updated
Remove all parameters from the url
Create a string containig all the parameters from a given object
Parameters
obj: Object
, An object containing keys and values
Returns: String
, The built string
Create a hash url string containig parameters
Parameters
hash: String
, A hash url
paramsObj: Object
, An object containing keys and values
Returns: String
, The built string