Javascript – Get escaped URL parameter


I'm looking for a jQuery plugin that can get URL parameters, and support this search string without outputting the JavaScript error: "malformed URI sequence". If there isn't a jQuery plugin that supports this, I need to know how to modify it to support this.


The value of the URL parameter, when decoded, should be:


(the characters are Norwegian).

I don't have access to the server, so I can't modify anything on it.

Best Solution

function getURLParameter(name) {
    return decodeURI(
        (RegExp(name + '=' + '(.+?)(&|$)').exec(||[,null])[1]