Loading full page using SPA

We have two approaches, The First is mapping the link directly using Ajax, as shown below

by adding axn=page.update: you can make a link to send an Ajax request to the “route_ajax” module and update the response to the page.

The second approach is using JavaScript, assuming the following HTML snippet

You can write the following code to achieve a similar result as the first approach

here is another sample in case we can’t add data-module to anchor tage

 

Updated on May 18, 2024