Recently, I tried to develop a simple online report. The basic workflow is as follows: The index.html page contains divelements, id"div_result"and there is no such content. The index.html page has a jQuery code to use $. get () to test. php sends a request and the returned content... recently, I tried to develop a simple online report. The basic workflow is as follows:
Index.htmlThere is a DIV element in the page, id ="P_result", No content by default;
Index.htmlThe page has a piece of jQuery code to use.$. Get ()Direction/Test. phpSend the request and return the html code of a table. use $ ("# P_result"Pai.html () is output to the p element of the current page.
The returned html code (table) contains jQuery code, which is used to process the table style (the rows are discolored and the selected rows are highlighted ).
Problems:
InChromeIn the browser: move the mouse over the table quickly, and the response speed of the special effects highlighted by the selected row is very fast.
In allIEIn the browser: the effect is obviously choppy, regardless of the number of rows in the table.
Stop$ ("P_result" pai.html (), ManuallyIndex.htmlInP elementAdd a static table and fill in the test data. Use the same jQuery code to Process Table effects. chrome and IE respond very quickly.
The main code is as follows:
Script function get_data (tb_typ) {$. ajax ({type: "get", url: "result. php ", data:" table_type = "+ tb_typ, cache: false, success: function(data={}('{result_p'}.html (data) ;}, databype:" html "})} $ (document ). ready (function () {var dataVal = "orders"; get_data (dataVal); // transcode the data in the row. Highlight var tb_obj = $ ('# my_table '); tb_obj.find ('tr: even '). addClass ('row _ even'); tb_obj.find ('tr: odd '). addClass ('row _ odd'); tb_obj.find ('tr '). not (': first '). mouseover (function () {$ (this ). addClass ('tr _ over ');}). mouseout (function () {$ (this ). removeClass ('tr _ over') ;}); script
Reply content:
Recently, I tried to develop a simple online report. The basic workflow is as follows:
Index.htmlThere is a DIV element in the page, id ="P_result", No content by default;
Index.htmlThe page has a piece of jQuery code to use.$. Get ()Direction/Test. phpSend the request and return the html code of a table. use $ ("# P_result"Pai.html () is output to the p element of the current page.
The returned html code (table) contains jQuery code, which is used to process the table style (the rows are discolored and the selected rows are highlighted ).
Problems:
InChromeIn the browser: move the mouse over the table quickly, and the response speed of the special effects highlighted by the selected row is very fast.
In allIEIn the browser: the effect is obviously choppy, regardless of the number of rows in the table.
Stop$ ("P_result" pai.html (), ManuallyIndex.htmlInP elementAdd a static table and fill in the test data. Use the same jQuery code to Process Table effects. chrome and IE respond very quickly.
The main code is as follows:
Script function get_data (tb_typ) {$. ajax ({type: "get", url: "result. php ", data:" table_type = "+ tb_typ, cache: false, success: function(data={}('{result_p'}.html (data) ;}, databype:" html "})} $ (document ). ready (function () {var dataVal = "orders"; get_data (dataVal); // transcode the data in the row. Highlight var tb_obj = $ ('# my_table '); tb_obj.find ('tr: even '). addClass ('row _ even'); tb_obj.find ('tr: odd '). addClass ('row _ odd'); tb_obj.find ('tr '). not (': first '). mouseover (function () {$ (this ). addClass ('tr _ over ');}). mouseout (function () {$ (this ). removeClass ('tr _ over') ;}); script