The Get variables of the URL need to be parsed. I have made a jQuery object of document.location and then have used the attr function to get the search attribute to get all the variables. But when i use the split function on it and after that each() is used it gives error stating that the object does not have a method each .
TypeError: Object [object Array] has no method 'each'
Code is :
$(document.location).attr('search').split('&').each()
I have also tried to use the search property in the first function but it does not allow it i.e $(document.location.search) gives error.
I have also checked that data type of the what is returned by split function, the console says that it is an object, i am also confused that it should have been an array.
P.S : all the above code goes in document.ready function of jQuery