]> git.parisson.com Git - telemeta.git/commitdiff
some minor changes to the ajax function (still work in progress)
authorriccardo <riccardo@parisson.com>
Wed, 2 Feb 2011 10:44:03 +0000 (11:44 +0100)
committerriccardo <riccardo@parisson.com>
Wed, 2 Feb 2011 10:44:03 +0000 (11:44 +0100)
telemeta/htdocs/timeside/src/controller.js

index af67a85911a4565adca0261b49290086e9615b82..e8e41dd5af803bcd89c63d94e10677158213e11c 100644 (file)
@@ -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);
+                    
                 }
+
             });
         },