I’m looking for the best way to dynamically update a web page content using Javascript AJAX.
My first thought is to store various div layouts each describing a different page in various files, for example:
BasicDiv.div:
<div>
<p>Some Text</p>
<button> A Button </button>
</div>
-Then create an empty div ,which content will be updated, inside the main webpage, then I make a XMLHttpRequest and update the div.innerHtml with the data loaded from the required file.
Is this a good way to use AJAX or do you have a better suggestion?
jquery ajax