See also: addAttribute getAttribute, deleteAttribute |
Parses a query string to set the value associated with the attribute.
JSV_setAttribute(expQ, attribute, value [, caseSensitive])
expQ.setAttribute(attribute, value [, caseSensitive])
The query string with the attribute set to the passed value.
The setAttribute function uses the following arguments.
Argument | Description |
expQ | The query string (e.g., ?ABC=123&L=Page1?Music=R%26B) that is to be parsed. |
attribute | The attribute name in the query string which to set the value. |
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. |
If the attribute does not exist in the query string, then JSV_setAttribute
will add the attribute/value pair to the query string.
The following lines of code
var qs = "?ABC=123&L=Page1&Music=R%26B";
var newQS = JSV_setAttribute(qs, "ABC", "Backus-Naur Form");
document.write(
"The query string " +
qs.bold() +
" is now " +
newQS.bold() );
produce
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.