How to create an object from the location/URL value in JavasScript/Jquery
- by DKinzer
I need a way to create an object from a location value. For example if I have the value:
'http://www.legis.state.pa.us/cfdocs/billinfo/bill_history.cfm?syear=2007&sind=0&body=S&type=B&bn=1'
which I get from doc.location.href();
I would like to make the following object:
myObject = {
syear : '2007',
snid : '0',
body : 's',
type : 'B',
bn : '1',
};
Thanks!
D