See also: getAttribute, setAttribute, deleteAttribute

Adds an attribute/value pair to a query string.

Syntax

JSV_addAttribute(expQ, attribute, value)

Prototype

n/a

Returns

The query string with the new attribute/value added.

Parameters

The addAttribute function uses the following arguments.

Argument Description
expQ The query string (e.g., ?ABC=123&L=Page1?Music=R%26B) that is to have a new attribute/value pair added.
attribute The attribute name to be placed in the query string.
value The value to set the attribute in the query string.
caseSensitive Optional. Boolean value that determines if the attribute name comparison is case sensitive. Default value is false.

Remarks

The JSV_addAttribute function will not add the attribute/value pair to the query string if the attribute or its value is an empty string.

Dependencies

n/a

Example

The following lines of code

var qs = "?ABC=123&L=Page1&Music=R%26B";
var newQS = JSV_addAttribute(qs, "Food", "Jack in the Box");
document.write( "The new query string is " + newQS.bold() );

produce