H
H
hollanditkzn2017-05-17 12:42:33
JavaScript
hollanditkzn, 2017-05-17 12:42:33

How do I use pjax to implement page clickability using jquery?

It turns out that if I reload the page, then everything exits normally, it goes to the view, But when you navigate the site using pjax, then in this case js does not work, it does not even receive a date-key

$(document).ready(function(){
  $('.trTable').on('click', function(){
    var key = $(this).data('key');
    document.location.href = "http://crm/frontend/web/zakaz/view?id="+key;
  });
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-05-17
@hollanditkzn

change
to
$('body').on('click', '.trTable', function(){

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question