I have links like
http://example.com?query1=query1&query2=query2 as href of anchor tag.
I want to do post ajax on href click using data from the query parameter from the link.
I have written code
$("a").bind('click',function(){
$.ajax({type:'post',url:$(this).attr('href'), success: function(data){
alert(data);
}})
return false;
});
but it does not send query parameter inside ajax post request. Request query data length is 0.
how can I change this code to manipulate data from query parameter of link ?
Edit
Sorry my bad but it is not working these are the request
Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:0
Query String parameter
action:delete
id:12
So these fields are not going inside request content.