How to change the navigation URL to asynchronous page loads

I used the following script, but it does not display the link URL.

<a href="<?php echo base_url();?>admin/football_manage/form" class="loadpage">add</a>
<div id="right_side_contnet"></div>

$(document).ready(function(){ 
   $('.loadpage').click(function(e){ 
      e.preventDefault() 
      $('#right_side_contnet').load(this.href) 
   }); 
});
+4
source share
1 answer

Ajax navigation cannot just change your browser history, and in fact, this is what you are looking for. This can be achieved using the story API introduced in HTML5 or using

  • Manipulating history manually using the history API. MDN , html5doctor
  • Use well-implemented third-party libraries to manage your story. I suggest pjax or history.js
+2
source

Source: https://habr.com/ru/post/1527933/


All Articles