Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 JavaScript: Read GET URL Variables Into An Associative Array. Jump to:  
Category: >> JavaScript >> Read GET URL Variables Into An Associative Array. Bookmark and Share

<< lastnext >>

Snippet Name: Read GET URL Variables Into An Associative Array.

Description: This snippet read a page's GET URL variables and return them as an associative array.

Also see:
» Count the number of checked checkboxes...
» Get Relative Dates and Times
» Read GET URL Variables Into An Associa...
» Neatly trim a string to a set number o...
» Get Current Page URL
» Get Current Directory Name
» Search array elements for a substring
» Add a period at the end of a string if...
» Count capital letters in a string
» Search All Words Of A String In mySQL
» Remove Extra Spaces From A String
» Get Query String with Javascript
» Get and set radio buttons with Javascr...
» Get and set select lists with Javascri...
» Get file extension
» Get Date 30 days ago
» Create string by formatting an amount ...
» Search PL/SQL for a string/ key value
» SEQUENCE: get sequence value into vari...
» SUBST and INSTR together
» INSTR (InString)
» SUBSTR (SubString)
» Generate unique strings of random numb...
» SELECT: Get DISTINCT / UNIQUE values
» SELECT: Get UNIQUE / DISTINCT values
» TIMESTAMP: Get current timestamp
» UPDATE: Update based on a query
» String Functions: REVERSE
» String Functions: LENGTH
» String Functions: INSTR

Comment: (none)

Language: JAVASCRIPT
Highlight Mode: HTML4STRICT
Last Modified: May 28th, 2010

// Read a page's GET URL variables and 
// return them as an associative array.
 
function getUrlVars(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
 
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
 
    return vars;
}


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 85 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?