Try Ajax written in jquery to flush asynchronously and organize HTML documents
$ ("Li.mod_cate"). Bind ("MouseOver", function () {///resolve the problem that the mouse moves to the submodule will also trigger Ajax var type = $ (This). attr ("name"); $.ajax ("url" +type+ "/", { datatype: " Jsonp ", data: " ", success: function (JSON) { var jsondata = json.data1; var txtHtml1 = ""; for (var i = 0; i < jsondata.length; i++) { if (jsondata[i].value1.length != 0) { var txthtml2 = "<li><table><tr><td>" +jsondata[i].colname+ "</td><td> <ul> "; var t1 = ""; for (Var j = 0; j < jsondata[i].value1.length; j++) { var txthtml3 = "<li><a href=\"/books/"+jsondata[i].value1[j].colid+jsondata[i].colname+"/" +jsondata[i].value1[j].colname+ "\" > "+jsondata[i].value1[j].colname+" </a></li> "; var t1 = t1 + txthtml3; } var t3 = txthtml2+t1+ "</ul></td></tr></table></li>";} else{ var t3 = "<li><table><tr><td> "+jsondata[i].colname+" </td></tr></table></li> "; } var txthtml1 = txthtml1+t3}; $ ("#" +type). HTML (TXTHTML1); //Custom Selector (&NBSP;&NBSP;&NBSP;&NBSP;});}). On ("Mouseout", function () { $ (this). Unbind ("MouseOver"); //solve the problem that the mouse moves to the submodule will also trigger Ajax});
Background JSON
Javascriptfunction = request.args["Callback"]return Javascriptfunction + "(" + json.dumps (kinds) + ");"
Ajax Asynchronous Refresh detailed application (website response speed optimization)