A kind of web page joint update method
Technical field
The present invention relates to a kind of WEB method for updating pages, especially a kind of web page joint update method.
Background technology
Along with the development of internet technique, the popularity of network is more and more higher, and the website has also obtained significant progress as the main contents supplier of the Internet.The website no longer is satisfied with content that unified standard only is provided but is wished can be more and user interaction and then can realize providing content service by user's demand.
Usually, the action of webpage is undertaken by page furbishing, singly is to refresh frequently the page to cause the user to browse frequently to be interrupted, and makes the user feel ophthalmic uncomfortable.For this problem, provide the update mode that does not refresh the page based on the Replace method of JavaScript, but this mode has problems also.Because the Replace method does not refresh the page, namely the page is not reorganized, but upgrade at the existing page, in a single day this just caused more, and the abnormal conditions such as responsive symbol appear existing in or the data long such as data in new data, can cause the collapse of part or full page form and then make user interface chaotic, make the user can't normal browsing.
Summary of the invention
For the problems referred to above that existing page refreshment mode exists, the invention provides a kind of web page joint update method that is intended to avoid page formatting collapse may when upgrading, occur.
The technical scheme that technical solution problem of the present invention adopts is:
A kind of web page joint update method wherein, comprises service end and be used for to show the client of hypertext document that described client is connected with described service end by medium of communication, specifically comprises the steps;
Step a, described service end are organized hypertext DOM node updates data according to the update request of described client;
Step b, described service end will be sent to described client after will organizing complete node updates data to encapsulate with the HTML annotation symbol;
The more new data that step c, described client send to accept described service end based on the browser of hyper text protocol;
Steps d, described client are resolved described more new data and the corresponding DOM node of described more new data are upgraded.
Above-mentioned web page joint update method, wherein, described client is resolved described more new data by the script that embeds hypertext document.
Above-mentioned web page joint update method, wherein, described client is upgraded described DOM node by the script that embeds hypertext document.
Above-mentioned web page joint update method, wherein, described service end comprises the request judge module, the described request judge module proposes update request to described client to be judged, and described client is returned in the unusual request that will determine.
The invention has the beneficial effects as follows:
Adopt the hypertext annotation symbol to encapsulate more new data, when making the browser-interpreted hypertext document more new data as annotation process, even more new data occurs unusually also can not having influence on page formatting.
Description of drawings
Fig. 1 is the FB(flow block) of a kind of web page joint update method of the present invention.
Embodiment
The invention will be further described below in conjunction with the drawings and specific embodiments, but not as limiting to the invention.
As shown in Figure 1, a kind of web page joint update method of the present invention wherein, comprises service end and be used for to show the client of hypertext document that client is connected with service end by medium of communication, specifically comprises the steps;
Step a, service end are organized hypertext DOM node updates data according to the update request of client;
Step b, service end will be sent to client after will organizing complete node updates data to encapsulate with the HTML annotation symbol;
The more new data that step c, client send to accept service end based on the browser of hyper text protocol;
Steps d, client are resolved more new data and the corresponding DOM node of new data are more upgraded, wherein client is resolved more new data by the script that embeds hypertext document, and by embedding the script renewal DOM node of hypertext document, script can form by the script that JavaScript or other scripts are write.
Because more new data is encapsulated by the hypertext annotation symbol, browser can not show it, has therefore avoided the user interface confusion that causes because upgrading data exception.And then utilizing the Replace method that each DOM node of hypertext document is upgraded after resolving by script, the page furbishing of avoiding has improved the continuity that the user browses.
Further, wherein, service end comprises the request judge module, the request judge module proposes update request to client and judges, and client is returned in the unusual request that will determine, like this can be at the issuable improper update of service end advanced processing, further reducing more, unusual possibility appears in new data.
The above only is preferred embodiment of the present invention; be not so limit claim of the present invention; so the means that the equivalent structure that all utilizations specification of the present invention and diagramatic content have been done changes and those skilled in the art habitually practise are replaced, and all are included in protection scope of the present invention.