Insus. NET a few days ago, there was a piece of code, "using JSONP cross-origin request data" http://www.cnblogs.com/insus/p/3512271.html is using jQuery DataType's jsonp to get remote data. However, netizens told Insus. NET privately that they would not use it. It mainly refers to the data provided by the remote end and a complete instance demonstration.
In the actual environment developed by Insus. NET, a code gun is used to scan the product that generates the process. First, full scanning is performed within the scanner, and then collected at a specific time (the purchased scanner is not transmitted to the computer in real time. The data collected to the computer is as follows, which is different from the actual situation. Some fields have been omitted:
After obtaining the data, Insus. NET thinking of the way is to use jQuery to get the data, so the code block "use JSONP cross origin request data" http://www.cnblogs.com/insus/p/3512271.html in the new site, first get the data, stored in DataTable, convert it to a json string and pass it to JQuery.
The following shows a data table:
Write another method to serialize the able into a json string:
First, you must reference the namespace using System. Web. Script. Serialization;
Create An aspx webpage and generate the callback function to call jQuery in the page_Load event of aspx. cs:
Next, you can use this method "use JSONP cross-origin request data" http://www.cnblogs.com/insus/p/3512271.html to get the data.
It should not be difficult. If you have any questions, you can continue to discuss them ......