I am trying overwrite links (transform in ajax links) but when I try to add an event to a tag nothing happens.
My script.
<script type="text/javascript">
$j(document).ready(function() {
$j(".will_paginate_styles a").each(function() {
if (this.innerText.length > 1) {
this.style.padding = "8px 6px 10px 6px";
var url = this.href + "&category_id=<%= 1 %>";
this.href = "#";
jQuery(this).live("click",
function(){
new Ajax.Request(url, {asynchronous:true, evalScripts:true, parameters:'authenticity_token=' + encodeURIComponent('uurmOp9OrgS1CRpcpKdMN9PHlMTt+lkHjhYdNgP+LbQ=')}); return false;
}
);
}
});
});
</script>
How could I attach a event to this tag or transform the link to ajax link? Any suggestions?
I am using JQuery.
This line belongs to prototype library
SO I replace this line for his equivalent in jQuery:
Obviously there are avalaible more options in this method. Read JQuery official documentation