Hi guys I'm working with a fairly basic function that grabs Url parameters and throws them into an object. I'm seeing a couple of things I haven't before and I was hoping you guys could help me understand what it means and why it's being used. I was unsure what to google. Here is the first one in the code I'm unsure of in red:
Code:jQuery.extend({ getUrlVars: function(){ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; }, getUrlVar: function(name){ return jQuery.getUrlVars()[name]; } });


Reply With Quote




Bookmarks