modURL()

Modify a URL.

This function is valid in v2.19.0 to v2.22.1. This function has been downloaded 15 times.

Parameters

{string=} opt_url Optional, Default:location.href
URL to modify and return. If undefined or null is specified this will default to the page's location.
{Object} options
An object indicating how to modify opt_url. Each property name should correspond to a valid URL property name. If a function is given as a property name it will be executed and the return value will be used as that property of the URL. Specifying a function for the "search" property will cause the function to be called with an object representing the current search parameters and the return result will be used to indicate what the new search parameters will be. Specifying an object for the "search" property will provide the ability to set individual search parameters with values or callback functions. If options.search is an object and has any properties set to undefined or null this will indicate that those properties should be removed, but any search parameters that are not defined as properties of options.search will remain.

Returns

{string}
The modified form of opt_url.

Required Functions

This function directly requires the following functions which are included automatically:

  • escape()
    Encodes a string to be used in a query part of a URL.
  • has()
    Every object descended from Object inherits the hasOwnProperty method. This method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check down the object's prototype chain.
  • nativeType()
    Gets the native type name of a primitive or an object. Unlike YourJS.typeOf(), the types are solely determined by the system.
  • parseQS()
    Parses a URL to get the parameters specified in the query string.