Question

there is header, footer, nav. and container divs. header, footer and nav div are same but content changes w.r.t on click function of nav elements.

lets say nav contains users,news,events tags. when we click events it will goes to event controller(many common(news,users) libraries will excutets say profile library for getting profile pic which shown in top of nav div and other picture which to show in header).

so, my idea is. since header, footer and nav are same, why can't we just fetch content div and load onClick function. which saves time using

$('#dynamic_content').load(href #dynamic_content);

My doubt: when we use above statement, i will also execute whole controller and fetch profile photos and all other photos. And from that data it just parse and get content which is in dynamic_content. how would it will save time?

Was it helpful?

Solution

It won't save any resource. You should return only the parts you need to be efficient.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top