1

I want to change the <div id="main"> content without reloading the page.

What is the best method for that? I want to do this for all of the links/buttons on my site

Feralheart
  • 1,881
  • 5
  • 28
  • 59
  • Possible duplicate of [HTML - Change\Update page contents without refreshing\reloading the page](https://stackoverflow.com/questions/3644585/html-change-update-page-contents-without-refreshing-reloading-the-page) – LF00 Oct 20 '17 at 08:08

2 Answers2

1

Use Ajax (Asynchronous JavaScript and XML) to load content and integrate it into your page without reloading the page itself.

See the following links for more information:

What is AJAX and how does it work?

Ajax tutorial for post and get

http://api.jquery.com/jquery.ajax/

Fabian S.
  • 2,441
  • 2
  • 24
  • 34
1

Since what you want is to use a div to show the whole app, I recommend using a JavaScript Framework for that.

Check out VueJS and how to integrate it with Laravel on this free course

Alternatively, you can check other Frameworks like Angular2, ReactJS, or even jQuery

Lloople
  • 1,827
  • 1
  • 17
  • 31