I have seen lots of jQuery examples where parameter size and name are unknown.
My URL is only going to ever have 1 string:
http://example.com?sent=ye
There's this great library: https://github.com/allmarkedup/purl
which allows you to do simply
url = 'http://example.com?sent=yes';
sent = $.url(url).param('sent');
if (typeof sent != 'undefined') { // sent exists
if (sent == 'yes') { // sent is equal to yes
// ...
}
}
The example is assuming you're using jQuery. You could also use it just as plain javascript, the syntax would then be a little different.