Created
August 19, 2010 20:47
-
-
Save tubbo/538873 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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