Skip to content

Instantly share code, notes, and snippets.

@gingerrific
Created June 18, 2014 02:30
Show Gist options
  • Save gingerrific/a1ad5b39f448f843e65f to your computer and use it in GitHub Desktop.
Save gingerrific/a1ad5b39f448f843e65f to your computer and use it in GitHub Desktop.
var comment = $('.imageComment').val();
//takes the value of the comment field and clears it
$('.imageComment').val('');
var url = $('.imageURL').val();
$('.imageURL').val('');
//creates a new instance of the constructor POST passing the three assigned variables
var outgoingPost = new Post();
outgoingPost.set({
'URL' : $('.imageURL').val(),
'Comment' : $('.imageComment').val()
});
@gingerrific
Copy link
Author

you're capturing a value and assigning it to url and comment respectively. however, within the 'set' you're assigning them to the values....that you just cleared out. so instead it should be

 outgoingPost.set({
    'URL'     :   url,
    'Comment' :   comment

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment