Skip to content Skip to sidebar Skip to footer

Capturing .click For URLs

I am relatively new to Javascript/Ajax. When the user clicks on certain urls, I wish to handle the click entirely with Javascript/jquery. Copy

Solution 2:

I am not sure about the intent of performing the redirection using javascript instead of href. Anyways, one of the approaches is here...

If you are implementing for modern browsers which support "data-" (HTML5) then you can use such attributes

<a class="row_edit" data-url="/sales_item/edit/{{ item.id }}" href="#"></a>

and modify the javascript to get the appropriate attribute value

 var url = $(this).attr("data-url") + "/";

Solution 3:


Post a Comment for "Capturing .click For URLs"