Saving elements to database with $.ajax()

Posted by Justin Meltzer on Stack Overflow See other posts from Stack Overflow or by Justin Meltzer
Published on 2011-03-16T00:08:37Z Indexed on 2011/03/16 0:09 UTC
Read the original article Hit count: 294

Filed under:
|
|
|

I'm trying to save dynamically created elements in my application.js file to the database. Would the code look something like this?:

$.ajax({
   type: "POST",
   data: { title: 'oembed.title', thumbnail_url: 'oembed.thumbnail_url'}
});

Is there anything I'm missing? Assume that oembed.title and oembed.thubnail_url hold the values I want to save, and that title and thumbnail are the database columns.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery