javascript - Ajax: replace the content of the container vs load in other div? -
i trying create ajax website. intuitive way seems to use jquery .html() method replace content of container new content.
however consider user may visit , b , again, second manipulation of reloading seems unnecessary.
another way occurs me load ajax content in new div , somehow hide original content. seems quite manual me , wonder there framework or plugins better handle this. , there performance issue in case since dom elements keep growing?
you can cache ajax requests, client javascript won't request server every time when need content. eg. in jquery:
$.ajaxsetup({ cache: true });
caching requests default setting in jquery caches responses time.
Comments
Post a Comment