0 0 0 0

In recent days, there was a problem with a module about editing notification announcements.

Is using ajax to retrieve data from the controller layer back to the map, and then assign the data to the problem that the data isn't displayed for the compiler

Initially thought that the data matching failed to check that the id found in every ajax corresponding to the html found there was no problem and was using console to print

Then the problem is locked in the compiler first the compiler needs to load the load order of two js js

<script language="javascript" src="../../../editor/kindeditor-all.js"></script>
<script language="javascript" src="../../../editor/lang/zh_CN.js"></script>
Then considering ajax is asynchronous data about ajax, which isn't a refresh page than the sync page. Refresh pages are blocked by the user, improved the user experience, but the problem is that the compiler has loaded the data, and it must have no data in the compiler, so there must be no data in it.

So follow this idea to put the compiler loaded scrip at the bottom of the html

 KindEditor.ready(function(K) {
 editor = K.create('#xx', {
 width : "100%", //编辑器的宽度为70%height : "200px", //编辑器的高度为100pxresizeType : 0,
 uploadJson : '../../../editor/jsp/upload_json.jsp',
 fileManagerJson : '../../../editor/jsp/file_manager_json.jsp',
 allowFileManager : false});

The test discovery didn't take account of the possibility that the data could be accessed by ajax when it was uploaded to html. The page has been loaded all where it wasn't included in the html.

It then tests that the function loaded by the compiler is placed in the ajax 's js to load the method and then find that it'll only call the method but

Finally, there are a lot of ways to include, and so on.

Finally, this line of code is added to ajax when the data load completes directly throws the data into the compiler. The problem is resolved.


Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs