in design,after online editing,return json url,callback not finish

This commit is contained in:
Kaito committed 2011-07-28 18:54:31 +08:00
1 parent 1839269581
commit c9e4d0f345
2 files changed
+12 -6

No files matched your search

+7 -1
View File
@@ -6,6 +6,7 @@ function r_editor(tgetUrl,tpostUrl,tfilename,toption){
editor.filename = tfilename;
editor.getUrl = tgetUrl;
editor.postUrl = tpostUrl;
editor.nodeToBeChanged=""
editor.width = toption['width'];
editor.height = toption['height'];
var html='';
@@ -27,7 +28,12 @@ function r_editor(tgetUrl,tpostUrl,tfilename,toption){
});
};
editor.send = function(){
$.post(editor.postUrl,{filename:editor.filename,context:html.children("textarea").val(),authenticity_token:$('meta[name=csrf-token]').attr('content')});
callback_for_send = function(data){
editor.postUrl = data;
alert($(this).attr("path"));
};
$.post(editor.postUrl,{filename:editor.filename,context:html.children("textarea").val(),authenticity_token:$('meta[name=csrf-token]').attr('content')},callback_for_send,"json");
};
editor.destroy = function(){
html.remove();