I don't really like that you're defining your function on the
String prototype, but I think it should work for your particular case.
Indeed, when I run it,
paramVal is equal to
"Test", so the problem must lie with your
initialize function.
I think you're better off declaring a function on the
Location prototype that returns an associative array of query parameters:
Now, you can do the following: