Skip to content

Instantly share code, notes, and snippets.

@phzbox
Created February 26, 2013 20:30
Show Gist options
  • Save phzbox/5041872 to your computer and use it in GitHub Desktop.
Save phzbox/5041872 to your computer and use it in GitHub Desktop.
// The JSON is provided by the server-side. It's a json string stored in the db.
var init_slides = JSON.parse('[{"url":"..."}]');
// When the form is submited, we're serializing the files and storing them in a hidden input field.
$('.submit-form').submit(function() {
$("#slides").val(JSON.stringify(uploaded_media_fpfiles));
});
// When the page is loaded for the first time, we're faking a file update using the fpfiles already saved.
uploaded_media(init_slides);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment