From 6f2e6f4ed8e7f213395e1fe8d44181883732bd48 Mon Sep 17 00:00:00 2001 From: riccardo Date: Wed, 2 Feb 2011 11:44:03 +0100 Subject: [PATCH] some minor changes to the ajax function (still work in progress) --- telemeta/htdocs/timeside/src/controller.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/telemeta/htdocs/timeside/src/controller.js b/telemeta/htdocs/timeside/src/controller.js index af67a859..e8e41dd5 100644 --- a/telemeta/htdocs/timeside/src/controller.js +++ b/telemeta/htdocs/timeside/src/controller.js @@ -164,8 +164,8 @@ TimeSide(function($N) { }, sendHTTP: function(marker){ -// var data2send = {"item_id": itemid, "public_id": marker.id, "time": marker.offset, -// "description": marker.desc}; + var data2send = {"item_id": itemid, "public_id": marker.id, "time": marker.offset, + "description": marker.desc}; //itemid is the item (spund file) name var sPath = window.location.pathname; @@ -176,16 +176,22 @@ TimeSide(function($N) { //don't change the order BELOW unless the relative python code for the server changes as //well: - var data2send = [itemid, marker.id, marker.offset, marker.desc]; + //var data2send = [itemid, marker.id, marker.offset, marker.desc]; $.ajax({ type: "POST", - url: "index.php", + url: "/json", method: "telemeta.add_marker", data: data2send, - //data: "name=John&location=Boston", - success: function(msg){ - alert( "Data Saved: " + msg ); + dataType: 'text', + contentType: 'application/json; charset=utf-8', +// success: function(msg){ +// alert( "Data Saved: " + msg ); +// }, + error: function(msg){ + alert("Error: "+msg); + } + }); }, -- 2.39.5