Getting URL parameters with Javascript

Ahmad Alfy 8th of May 2012

function getURLParameter(name) {
    return decodeURI(
        (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
    );
}
274
Views
0
Comments
1
Downloads
Comments
Only Code Pad members can post comments!

Want to join Code Pad Request An Invite
    No Comments Posted

Suppo - Create, Customize & Host
Your App Support Page at Suppo

Snippet Details

Keyboard Shortcuts

DDownload

TTweet

FFull View

Next Snippet

Previous Snippet