I am creating a widget where someone can post a note about the page
(feedback).  I am currently using AJAX to pass the information to my
server, but I want to now use JSON, so that I can put it on one of my
other domains and still send the info to my original domain.  This is
the function I currently have:

function saveNote(obj, cancel) {
    var note_html = $(obj).parents(".note");
    var page_id = getPageId($(obj));
    if(!cancel) {
        var t = note_html.find("textarea").val();
        var url = G_MAIN_DOMAIN + "/page/addNote";
        $.post(url, { page_id: page_id, note: t },function(data){});
    } else {
        var t = cancel;
    }
    if(t=='') t='(click to add text)';
    note_html.html("<a href='#' class='edit_note'>" + t + "</
a>");
}


I want to change the $.post to something that sends out a JSON
object.  Do I need to create another function or how do I do this?
Thanks for the help!

Reply via email to