Skip to content

Instantly share code, notes, and snippets.

@hadrienl
Created November 29, 2011 10:24
Show Gist options
  • Save hadrienl/1404323 to your computer and use it in GitHub Desktop.
Save hadrienl/1404323 to your computer and use it in GitHub Desktop.
[…]
forms.item(1).on(
'submit',
function(e)
{
e.preventDefault();
this._upload(e.target)
},
this
);
[…]
_upload: function(form)
{
Y.io(
Y.config.api+'images/upload',
{
method: 'POST',
form: {
id: form,
upload: true
},
on: {
complete: function(id, data)
{
console.debug(data);
}
},
context: this
}
);
}
[…]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment