See also: addAttribute, setAttribute, deleteAttribute |
Parses a query string to find the value associated with the attribute.
JSV_getAttribute(expQ, attribute [, caseSensitive])
expQ.getAttribute(attribute [, caseSensitive])
The value of the attribute.
The getAttribute 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 whose value is to be obtained. |
caseSensitive | Optional. Boolean value that determines if the attribute name comparison is case sensitive. Default value is false. |
If the attribute does not exist within the query string, JSV_getAttribute
returns an empty string.
If error checking is required, use the
JSV_isEmpty
function to check the value returned by JSV_getAttribute
.
The following lines of code
var qs = "?ABC=123&L=Page1&Music=R%26B";
var value = JSV_getAttribute(qs, "Music");
document.write( "The attribute <I>Music</I> has a value of " + value.bold() );
produce
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.