Reputation: 119
I have a page that contains a big chunk of contents generated dynamically by the server in the same domain & web app, I have total control of the page and the generation of the contents. So I have 2 options here :
use IFrame to load the contents and change src attribute when contents refresh.
Ajax
Please note that the contents could be refreshed & changed to other contents, that means the iframe's src could be dynamically changed or the ajax contents could be refreshed frequently depending on the user.
Providing that I will clean up the iframe's/Ajax's resources(html, javascript objects,event listeners, etc) before unload/refresh, which option is preferable in terms of performance and memory usage if the contents are refreshed frequently? And what I should keep an eye on when doing frequent contents refresh?
Thank you.
Upvotes: 2
Views: 237
Reputation: 982
If I were you I would go for AJAX, for a number of reasons:
Generally, I would say a good rule is: Don't use anything it wasn't made for on a large scale
Upvotes: 1