Now, there is an increasingly popular "old" technology that can change this embarrassing situation. That's Ajax. Nowadays, with the application of Gmail, Google-maps and the support of various browsers, Ajax is gradually attracting the attention of the world. Refresh the web page - wait. . . -- Refresh the web page -- Wait. . .
Do you often encounter the above situation when you use your browser to browse the web? Do you feel pain or even anger when you are faced with a blank and slow-moving screen?
Now, there is an increasingly popular "old" technology that can change this embarrassing situation. That's Ajax. Nowadays, with the application of Gmail, Google-maps and the support of various browsers, Ajax is gradually attracting the attention of the world.
1. Introduction to Ajax technology
AJAX (Asynchronous JavaScript and XML, that is, asynchronous JavaScript + XML) is actually a combination of multiple technologies. As Jesse James Garrett, the name of Ajax, pointed out:
Ajax is not a technology. It is actually several technologies, each thriving in its own right, combined in powerful new ways.
Ajax mainly covers the following aspects of technology:
-- Use XHTML and CSS to achieve presentation based on various standards.
-- Use the Document Object Model to achieve dynamic display and interaction.
--Use XML and XSLT to realize data exchange and operation.
-- Use XMLHttpRequet to implement asynchronous data retrieval.
-- JavaScript ties it all together.
Unlike traditional Web applications, Ajax uses an asynchronous interaction process. Ajax introduces an intermediary between the user and the server, thus eliminating the processing-waiting-processing-waiting shortcomings in the network interaction process. The user's browser loads the Ajax engine when performing tasks. Ajax engines are written in JavaScript language, usually hidden in a hidden framework. It is responsible for compiling the user interface and interacting with the server. The Ajax engine allows the interaction process between the user and the application software to proceed asynchronously, independent of the communication between the user and the network server. The principle of AJAX is to "fetch data on demand". Using Ajax can minimize the burden on the server caused by redundant requests and responses.
2.Ajax technology and ERP
The current mainstream ERP adopts a B/S architecture. In the actual application of ERP, there are also many problems that cannot be solved by traditional Web development methods. Although Ajax technology needs to be further improved and matured, it will undoubtedly be beneficial to both developers and customers to properly research and introduce Ajax development ideas and technologies in ERP development to solve problems that are difficult to deal with with traditional methods.
The following is a brief discussion on the possible application scenarios of Ajax technology in ERP.
(1)Data verification
When filling in and updating form content, sometimes it is necessary to put the updated data into the database for data verification. There are usually two ways of traditional data verification: one is to fill in the form directly and then submit the form. This method requires the page to be submitted to the server for verification. The whole process is not only long but also causes unnecessary burden on the server; second, The first method is an improved verification process. Users can click the corresponding verification button to open a new window to view the verification results. However, this requires opening a new browser window or dialog box, and also requires a specially written verification page, which consumes system resources. . Using Ajax technology, the XMLHttpRequet object can issue a verification request, and determine whether the verification is successful based on the returned HTTP response. The entire process does not require popping up a new window or submitting the entire page to the server, which is fast and does not increase the burden on the server.
(2)Tree structure
Classification trees or tree structures are widely used in ERP systems. Applying Ajax technology can improve the implementation mechanism of classification trees. When initializing the page, only the data of the first-level subcategory is obtained and displayed; when the user clicks on the first node of the first-level category, the page will request the server through Ajax for all data of the second-level subcategory to which the current category belongs; if When requesting a node of the already presented second-level category, request the server again for all data of the third-level subcategory to which the current category belongs, and so on. The page will request the data it needs from the server based on the user's operations, so there will be no data redundancy and the total amount of data downloaded will be reduced. At the same time, there is no need to reload all the content when updating the page. Only the part of the content that needs to be updated can be updated. Compared with the previous background processing and reloading method, the user's waiting time is greatly shortened.
(3)Data automatically updated
Before the advent of Ajax, users had to constantly refresh the page to see if there were any new content changes in order to understand the corresponding content, or the page itself could implement a scheduled refresh function. This may happen; for a period of time, the content of the web page has not changed, but the user does not know it and continues to refresh the page; or the user loses patience and gives up refreshing the page, but it is very likely that there will be new content here. news appears, thus missing the opportunity to get the news as soon as possible.
Applying Ajax can improve this situation. After the page is loaded, the Ajax engine will perform regular polling in the background and send a request to the server to see if there is the latest news. If there is, the new data (not all data) will be downloaded and dynamically updated on the page, notifying the user in a certain way (implementing such a function is the strength of JavaScript). This avoids the inconvenience of users constantly refreshing the page manually, and does not waste resources caused by repeatedly refreshing the page.
It should be noted that although Ajax has received widespread support, in actual development, you still need to pay attention to cross-browser issues, mainly in the JavaScript programming part. However, many popular frameworks encapsulate these details and can solve this problem. On the other hand, if users are still heavily using earlier browser versions, Ajax technology may not be effective, which should be noted when implementing it.
Ajax provides new opportunities for Web application development and also puts forward new requirements for ERP systems. When users experience a new experience because of Ajax technology, the winner will not just be the user.