Is there a simple way to get the parameters at the end of an href attribute of a clicked link using the click event object?
I have some jQuery code that looks like this:
You can use the this.href method to read the link attribute:
this.href
$('#pages').delegate("a", "click", function(e) { var str = this.href.split('?')[1];
Example:
str = 'friends.php?term=ma&p=2'; console.log(str.split('?')[1]); // output: term=ma&p=2