Yes.
It is possible. As David Dorward says above you must
parse window.location. If you cannot made this alone
you can use this function.
/**
* This function assumes a url
* or other string as a argument
* and return hash with url-s
* parameters in the type:
* myhash['getparamname'] = getparam val
* usage:
* var $GET = parseWindowLocation(window.location.href);
* alert($GET['valname']);
* will show the value of GET
* variable undefined otherwise.
* @param string aLocation
* @author
* Georgi Naumov
* (e-mail address removed)
*/
function parseWindowLocation(aLocation)
{
var re = /[?&]([^=]+)=([^&]+)/g;
var maches = null;
var urlParts = new Array();
maches = aLocation.match(re);
if(maches != null)
{
for(var i=0;i< maches.length;i++)
{
var urlPart = maches
.split("=");
urlParts[urlPart[0].substr(1)] = urlPart[1];
}
}
return urlParts;
}
Good Luck !
David Dorward :
That isn't a URL. The slashes are going in the wrong direction.
And please use example.com (or net or org) for examples (unless you're
a representative of KWIKWEB)
You can parse window.location.search. There isn't a built in system
that splits key/value pairs on ampersands and semi-colons and
constructs an object for you.