javascript - Loading Tab Content With Ajax Call -


i have tab control loads content via $().load() , page loaded load data json call server. i'm not sure if efficient way go this.

basically i'm wondering best way load tab content contain ajax call json data. i'm thinking these ajax calls hinder performance.

$("#tab-about").click(function () {      $("#tab-content").load("/about");      /* content have it's own ajax call json data */ }); 

the performance issue depends on project.but code can become buggy. make sure put second ajax call in settimeout because may not called when upload website.try :

settimeout(function(){ /*your code ajax load content */   },0); 

function in settimeout run after containing function finished.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -