Kindeditor.ready (function(K) {//editor plugin Window.editor1= K.create (' #ctjs ', {uploadjson:'/hotelgl/uploadimage ', Allowfilemanager:false,//allow image management to be opened and then select images directly from the image space to selectWidth: ' 480px ', Height:' 150px ', Afterblur:function() { This. sync ();} }); K (' #ctjs '). Click (function() {Editor1.loadplugin (' Image ',function() {Editor1.plugin.imageDialog ({showremote:false, Imageurl:k (' #PicUrl '). Val (), CLICKFN:function(URL, message, error) {alert ("Upload successful!"); Editor1.hidedialog (); } }); }); }); });
AJAX: transcoding with encodeURIComponent (text)
$.ajax ({//asynchronously AddType: "POST", URL:"/repast/ctgladd", data: {TJCTMZ: $.trim ($ (' #ctmz '). Val ()), TJCTSJ: $.trim ($ (' #ctsj '). Val ()), Tjctwz: $.trim ($ (' #ctwz '). Val ()), TJCTDH: $.trim ($ (' #ctdh '). Val () ), tjctjs:encodeuricomponent (text), Hotelid:hotelid, Gnbh:parseint ($ ("#gnbh"). Val ()), Cz:cz}, Success:function(data) {varf =$.parsejson (data); if(F.yz) {alert ("Add success!"); if($ ("#ctcx"). Length > 0) { $('. Catering_details p DFN '). Trigger ("click"); $("#ctcx"). Trigger ("click")); } Else{location.replace (location.href); } } Else{alert ("Add failed!"); Location.replace (LOCATION.HREF); } } })
Front Desk: decodeuricomponent (F.CTJS)
1 //------Query-------------2$ (". Catering_page"). Delegate (' Li. Details '), {3Click:function(e) {4$ (' #show '). Show ();5$ ("#show. Btn_ok"). attr ("Name", $ ( This). attr ("name"));6Xgid = parseint ($ ( This). attr ("value"));//global variable Save database specify corresponding ID number7 $.ajax ({8Type: "POST",9URL: "/REPAST/CTGLCX",Ten data: {cxid:xgid}, OneSuccessfunction(data) { A varf =$.parsejson (data); -$ ("#ctmz"). Val (f.name); -$ ("#ctsj"). Val (f.time); the$ (' #ctwz '). Val (f.address); -$ (' #ctdh '). Val (F.tel); - editor1.html (decodeURIComponent (F.ctjs)); - } + }) - } +})
Ajax in the parameters with HTML format of the incoming background save "two"