Skip to content

Instantly share code, notes, and snippets.

@tubbo
Created August 19, 2010 20:47
Show Gist options
  • Select an option

  • Save tubbo/538873 to your computer and use it in GitHub Desktop.

Select an option

Save tubbo/538873 to your computer and use it in GitHub Desktop.
function renderForm() {
$("#form-accordion").accordion({ // the entire form is stored in an ajax accordion
fillSpace: true,
animation: 'slide',
navigation: true,
change: function(ev, ui) {
var content_div = ui.newContent.attr("id");
// replaces new <div> content with the content from inc/[[id]].html
$.get('inc/'+content_div+'.html', function(data) {
ui.newContent.replaceWith(data);
console.log("loaded new content into #"+content_div+" from inc/"+content_div+".html");
});
// loads default content into the old <div> so the "loading" screen appears if a connection is too slow
//ui.oldContent.replaceWith("<img src='img/spinner.gif' alt='Loading...' />");
//console.log("replaced old content in #"+ui.oldContent.attr("id"));
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment