CN100437579C - Method for realizing AJAX webpage - Google Patents

Method for realizing AJAX webpage Download PDF

Info

Publication number
CN100437579C
CN100437579C CNB2005101210667A CN200510121066A CN100437579C CN 100437579 C CN100437579 C CN 100437579C CN B2005101210667 A CNB2005101210667 A CN B2005101210667A CN 200510121066 A CN200510121066 A CN 200510121066A CN 100437579 C CN100437579 C CN 100437579C
Authority
CN
China
Prior art keywords
data
webpage
xml
html
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CNB2005101210667A
Other languages
Chinese (zh)
Other versions
CN1987850A (en
Inventor
黄希彤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CNB2005101210667A priority Critical patent/CN100437579C/en
Publication of CN1987850A publication Critical patent/CN1987850A/en
Application granted granted Critical
Publication of CN100437579C publication Critical patent/CN100437579C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

This invention relates to an AJAX net realization method, and it includes the process as follow: S1 the server will return the self-determination static net and sign engine script after accepting the HTTP requirement of the client browser. S2 the server will return the XML data alternant with the client according to the alternation information of the self-determination static net with the users. S3 the talked engine script can translate the XML data to HTML data and finish the display of the dynamic net. The realization of this invention makes the net developing people develop the dynamic AJAX net by the traditional net sign method, and it can reduce the developing load, improve the reliability of the software, and bring the better experience of the users, and further prompt the display of net and the separating of the data.

Description

A kind of method that realizes the AJAX webpage
Technical field
The present invention relates to network technology, be specifically related to the AJAX web technologies, more particularly, relate to a kind of method of the AJAX of realization webpage.
Background technology
Along with the continuous development of internet, traditional dynamic web page development technique is familiar with by many webpage making personnel.In recent years, enrich internet application (Rich Internet Application, be called for short RIA) rise of development mode make the Internet user to network interaction impression have higher requirement, traditional technology can't satisfy the needs of RIA exploitation, and AJAX (Asynchronous JavaScriptand XML is called for short AJAX) begins to become the RIA development mode of main flow.AJAX be one combine DHTML technology, XML (extend markup language, eXtensible Markup Language) and JavaScript etc. programming technique.AJAX is not a new language or technology, and it is actually several technology and combines performance effect separately in common cooperation by certain mode.AJAX is to use the web application development approach of client script and web page server swap data.Like this, Webpage need not interrupt interaction flow and reload, and just can dynamically upgrade.The characteristics of a maximum of AJAX webpage are to need not to refresh the page just can or read and write data to Server Transport (be called again not have and refresh the refresh page face).
Traditional ASP (Active Server Pages, the active server webpage)/JSP (Java ServerPages) dynamic web page development mode is to have realized that by the mark of its agreement of server parses dynamic web page generates and data exhibiting, upgrades the data that newly represent by page furbishing when data change.Under this interactive mode, trigger a HTTP by the user and ask server, when request that the server process client is submitted to, server need intactly be resolved the page and generate HTML code and be represented in the page, but the user can only idle waiting, and once very little maybe needing alternately obtains very simple data from server end, all will return a complete html page, wasted time and bandwidth and removed to read again full page.Therefore, consume too much server resource and network bandwidth resources, influenced the speed of server and user interactions, destroyed user's mutual impression.
Existing realization AJAX pattern generally realizes by following 3 kinds of modes:
(1) AJAX can utilize the Javascript script technology to control the built-in XML control of browser, thereby realizes that the AJAX page does not have the dynamic data that refreshes and represents.If adopt in each page compile script analyzing XML data and be presented in the page development that the development mode of this realization AJAX can be brought very large front page layout; If by the backstage return behind the complete XML file with script (utilizing control) resolve generate behind the xml html code irritate back again the page layer in, the development mode of this realization AJAX also can be brought the coupling of very large background program, and causes backstage XML data to be difficult to reuse and buffer memory.
(2) ZK comprise one based on AJAX can carry out automatically interactive operation the event-driven engine and one the cover compatible XUL assembly, can represent application program and operate these assemblies with assembly, thereby realize that the AJAX page does not have the dynamic data that refreshes and represents with XUL characteristic by the monitoring incident that triggers by the user.But what the development mode of this realization AJAX was brought is this technical threshold of XUL, and the backstage can only be bundled in the J2EE server, has limited AJAX The Application of Technology scope.
(3) Google AJAXSL (http://goog-ajaxslt.sourceforge.net) is a Javascript framework, is used for carrying out XSLT conversion and XPath inquiry, thereby realizes that the AJAX page does not have the dynamic data that refreshes and represents.Just used this technology at Google Map at present.But the development mode of this realization AJAX is also brought this technical threshold of XSLT, and has improved webpage development personnel's learning curve, has increased the complexity of webpage development.
Summary of the invention
The technical problem to be solved in the present invention is, the defectives such as development technique complexity that above-mentioned traditional ASP/JSP page interactive efficiency at prior art is low, the user experiences difference and current AJAX provide a kind of and utilize the marking engine script to realize the method for AJAX webpage based on the customize tag webpage.
The technical solution adopted for the present invention to solve the technical problems is: construct a kind of method that realizes the AJAX webpage, may further comprise the steps:
S1. server receives the webpage that returns described request after the request of client to described client, and this webpage is provided with the marking engine script;
S2. described server returns the XML data according to described webpage and user's interactive information to described client;
S3. described marking engine script is a html data with described XML data parsing.
On webpage of the present invention, use customize tag.
, before step S1, also comprise in the present invention:
According to foreground and background data interface agreement, determine the XML template;
According to described XML template development background program;
Adopt customize tag design webpage and load the XML template data by the marking engine script;
Connect timing at server and client, replace employed XML template data in the design process with the dynamic XML data.
Be that html data specifically comprises with described XML data parsing described in the step S3:
S31. call described marking engine script and receive described XML data and judge whether webpage carries out mark for the first time and resolve, if, execution in step S32 then, if not, execution in step S33 then;
S32. the application programming interface that provides by browser (Application ProgrammingInterface is called for short API) obtains the HTML code of webpage and preserves original HTML code;
S33. fetch the original HTML code before resolved last time;
S34. obtain described HTML code and successively decomposite wherein customize tag with the recursive algorithm analysis;
S35. find out circulation, judgement and replacement logic and circulation, judgement and the replacement logic of described use and the mapping relations between the described XML data that needs use in the described HTML code according to the described customize tag that successively decomposites;
S36. passing through successively, recurrence generates final HTML code with the described customize tag of described XML data filling needs replacement;
S37. the api interface that provides by browser turns back to client with the HTML code of described generation.
At marking engine script of the present invention is to write with the JavaScript script.
In step S2 of the present invention, described interactive information is the data message of user's request dynamic displaying web page content information or user's input.
Customize tag described in the present invention is used to control page resolution logic.
At customize tag of the present invention is the ASP/JSP mark.
The beneficial effect of implementing the inventive method is, allow the webpage development personnel to adopt traditional page marks technological development AJAX dynamic page, reduced the development amount, improved the reliability of software, bring better user experience, further promote separating of webpage representation and data.
Description of drawings
Below in conjunction with drawings and Examples, the invention will be further described, in the accompanying drawing:
Fig. 1 utilizes the inventive method to realize the process flow diagram of AJAX webpage;
Fig. 2 utilizes the inventive method to realize the structured flowchart of AJAX webpage;
Fig. 3 is the realization flow figure that utilizes the marking engine script of the inventive method.
Embodiment
Traditional ASP and JSP technology are closely similar, and the both is provided at the ability of mixing certain program code in the HTML code, being explained the executive routine code by language engine.Under ASP or JSP environment, HTML code mainly is responsible for the Show Styles of descriptor, and program code then is used for describing processing logic.Common html page only depends on Web server, and language engine analysis that the ASP and the JSP page need add and executive routine code.The execution result of program code is embedded in the HTML code again, sends to client browser then together.ASP and JSP are the technology towards Web server, and client browser is without any need for additional software support.
Traditional ASP webpage comprises HTML mark, plain text, VB Script or Jscript shell script code and com component etc., and its file extension is .asp rather than .html or .htm.When client browser is browsed the ASP webpage, server is according to the request that receives this asp page face, send back to client browser by the ASP.DLL file with the from first to last resolved execution of ASP file and according to the html page of order request generation response, what client browser was seen like this is exactly the webpage that dynamically generates.
Traditional JSP page is actually a Web page that has conventional HTML mark and Java code.The file extension of the JSP page is .jsp.When client browser is browsed the JSP webpage, server is according to the request that receives this JSP page, this jsp file is transformed into the Servlet of a pure Java by the JSP engine, then it is compiled into the Servlet syllabified code, this Servlet can call other Servlet or JavaBeans, at last the execution result html page of Servlet is sent back to client browser, what client browser was seen like this is exactly the webpage that dynamically generates.
Therefore, mention as background technology, the user and the page carry out when mutual, server end all will return a complete HTML page or leaf at every turn, like this, the user will lose time at every turn and bandwidth removes to read again full page, has consumed too much server resource and network bandwidth resources, influence the speed of server and user interactions, destroyed user's mutual impression.
At above-mentioned situation, the present invention utilizes the AJAX webpage of marking engine script realization based on the customize tag development mode.Customize tag refers to be used to control page resolution logic, and browser can't be resolved voluntarily, traditionally by the page marks of server parses, customize tag can be traditional ASP/JSP mark, also can be other server page mark, implementation procedure of the present invention as shown in Figure 1 and Figure 2
S1. server receives the webpage that returns described request after the request of client to described client, and this webpage is provided with marking engine script (in the step 100);
S2. described server returns XML data (in the step 102) according to described webpage and user's interactive information to described client;
S3. described marking engine script is html data (in the step 104) with described XML data parsing.Being labeled as example with traditional ASP/JSP below is described the performance history that realizes the AJAX webpage.
At first, web page foreground developer and backstage service routine developer need to consult the data-interface of agreement AM/BAM when exploitation AJAX webpage, can design the template of XML data with the form of instance data.XML and HTML are similar, and it is a kind of SGML that uses label, and the form that is independent of platform and application program is provided for data description.Although XML and HTML be usage flag, they are different, and HTML merges data and demonstration, and inseparable, XML then can promptly use data and display separation HTML to show, data are placed among the XML.Like this, showing which type of webpage on different platforms, is the thing of HTML, be placed in .htm or the .html file, and data is constant, all leave in the .xml file.The backstage developer then can be according to the agreement exploitation background program of above-mentioned XML template.
And the foreground developer just can adopt traditional ASP/JSP marker development technical design webpage, finish the function design of base page after, just begin to create XML document.XML document has comprised a whole set of character string corresponding to html page.In order to give variable with the data assignment in the .xml file, and variate-value is inserted in the html stream, just need in the ASP/JSP page, insert the marking engine script, load the XML template data by the marking engine script, and the XML data are converted to common HTML content, even the browser of earlier version is also supported XML, can see these dynamic web contents equally.
The implementation procedure of marking engine script as shown in Figure 3, call described marking engine script and receive described XML data (in the step 300), and judge whether webpage carries out mark for the first time and resolve (in the step 302), if, then the api interface that provides by browser obtains the HTML code (in the step 304) of webpage, and preserve original HTML code (in the step 306), if not, then fetch the original HTML code (in the step 308) before resolved last time; The described HTML code that obtains with the recursive algorithm analysis also successively decomposites ASP/JSP mark (in the step 310) wherein then; Find out circulation, judgement and replacement logic and circulation, judgement and the replacement logic of described use and the mapping relations (in the step 312) between the described XML data that needs use in the described HTML code according to the described ASP/JSP mark that successively decomposites; Filling with described XML data by recurrence successively needs the described ASP/JSP mark replaced, generates final HTML code (in the step 314); The api interface that provides by browser is written back to (in the step 316) on the page with the HTML code of described generation.Therefore, the user is undertaken when mutual by client browser control and static page, server only need return that part of page XML data that the user asks, rather than return the html data of full page, avoided on network sending the page info that those not have change, having realized can just can be to the Server Transport or the service data that reads and writes data under the prerequisite that does not refresh full page.When server returns the XML data to static page the time, static page promptly can resolve to html data to realize representing dynamic web content to the user with it by invocation flags engine script.At last, the AM/BAM developer connects timing at server and client, replaces employed XML template data in the design process with the dynamic XML data, so just can finish the exploitation of AJAX webpage.With used asynchronous data loading technique, XML and JavaScript etc. the webpage of programming technique be called the AJAX webpage.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1, a kind of method that realizes the AJAX webpage is characterized in that, may further comprise the steps:
S1. server receives the webpage that returns described request after the request of client to described client, and this webpage is provided with the marking engine script;
S2. described server returns the XML data according to described webpage and user's interactive information to described client;
S3. described marking engine script is a html data with described XML data parsing.
2, method according to claim 1 is characterized in that, uses customize tag on the described webpage.
3, method according to claim 2 is characterized in that, before step S1, also comprises:
According to foreground and background data interface agreement, determine the XML template;
According to described XML template development background program;
Adopt customize tag design webpage and load the XML template data by the marking engine script;
Connect timing at server and client, replace employed XML template data in the design process with the dynamic XML data.
4, method according to claim 3 is characterized in that, is that html data specifically comprises with described XML data parsing described in the step S3:
S31. call described marking engine script and receive described XML data and judge whether webpage carries out mark for the first time and resolve, if, execution in step S32 then, if not, execution in step S33 then;
S32. the application programming interface that provides by browser obtains the HTML code of webpage and preserves original HTML code;
S33. fetch the original HTML code before resolved last time;
S34. obtain described HTML code and successively decomposite wherein customize tag with the recursive algorithm analysis;
S35. find out circulation, judgement and replacement logic and circulation, judgement and the replacement logic of described use and the mapping relations between the described XML data that needs use in the described HTML code according to the described customize tag that successively decomposites;
S36. passing through successively, recurrence generates final HTML code with the described customize tag of described XML data filling needs replacement;
S37. the application programming interface that provides by browser turns back to client with the HTML code of described generation.
5, method according to claim 1 is characterized in that, among the described step S2, described interactive information is the data message of user's request dynamic displaying web page content information or user's input.
6, according to any described method of claim 1-5, it is characterized in that described marking engine script is to write with the JavaScript script.
7, according to any described method of claim 2-4, it is characterized in that described customize tag is used to control page resolution logic.
8, method according to claim 7 is characterized in that, described customize tag is the ASP/JSP mark.
CNB2005101210667A 2005-12-20 2005-12-20 Method for realizing AJAX webpage Active CN100437579C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005101210667A CN100437579C (en) 2005-12-20 2005-12-20 Method for realizing AJAX webpage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005101210667A CN100437579C (en) 2005-12-20 2005-12-20 Method for realizing AJAX webpage

Publications (2)

Publication Number Publication Date
CN1987850A CN1987850A (en) 2007-06-27
CN100437579C true CN100437579C (en) 2008-11-26

Family

ID=38184649

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005101210667A Active CN100437579C (en) 2005-12-20 2005-12-20 Method for realizing AJAX webpage

Country Status (1)

Country Link
CN (1) CN100437579C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510377A (en) * 2011-10-31 2012-06-20 北京锐安科技有限公司 Webpage interaction accelerating asynchronous data processing method and system

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101122921B (en) * 2007-09-21 2011-09-28 北京意科通信技术有限责任公司 Method forming tree-shaped display structure based on ajax and html
CN101442515B (en) * 2007-11-22 2011-09-07 深圳市科陆电子科技股份有限公司 Remote control method based on browser
ATE466474T1 (en) 2008-01-09 2010-05-15 Rp Technik E K MICROCONTROLLER-CONTROLLED EMERGENCY LIGHTING SYSTEM AND SUITABLE COMMUNICATION METHOD THEREOF
CN101610195B (en) * 2008-06-17 2011-10-26 上海格尔软件股份有限公司 Method for AJAX cross-domain synchronous transmission of high volume data
CN101610194B (en) * 2008-06-17 2011-11-23 上海格尔软件股份有限公司 Method for AJAX cross-domain asynchronous transmission of high volume data
CN101609399B (en) * 2008-06-20 2013-07-03 鸿富锦精密工业(深圳)有限公司 Intelligent website development system based on modeling and method thereof
CN102253946A (en) * 2010-05-20 2011-11-23 腾讯科技(北京)有限公司 Lua script interactive information-based method, Web engine and embedded terminal
CN102075572B (en) * 2010-12-29 2013-05-01 北京遥测技术研究所 Embedded type web server
CN102279862A (en) * 2011-05-10 2011-12-14 中兴通讯股份有限公司 Data processing device and method based on Ajax
CN102184266B (en) * 2011-06-27 2012-08-29 武汉大学 Method for automatically generating dynamic wireless application protocol (WAP) website for separation of page from data
CN102355449B (en) * 2011-06-30 2014-09-17 深信服网络科技(深圳)有限公司 Method, gateway and system for implicitly transmitting reorientation request
CN103139260B (en) 2011-11-30 2015-09-30 国际商业机器公司 For reusing the method and system of HTML content
CN102571934A (en) * 2011-12-22 2012-07-11 深圳华强电子交易网络有限公司 WEB page data binding method
CN103778117B (en) * 2012-10-17 2018-11-09 腾讯科技(深圳)有限公司 A kind of method and system of information of mobile terminal load
CN103347081B (en) * 2013-07-10 2016-08-31 中国建设银行股份有限公司 The requesting method of a kind of self-defined page and system
CN104462090A (en) * 2013-09-13 2015-03-25 方正信息产业控股有限公司 Method and device for processing data
CN104461513B (en) * 2014-11-21 2018-01-09 山东航天信息有限公司 A kind of method and device for generating form interface
CN104378446A (en) * 2014-12-02 2015-02-25 上海雷尼威尔技术有限公司 Vehicular LNG (liquefied natural gas) cylinder measurement information remote monitoring system and vehicular LNG cylinder measurement information remote monitoring method
CN104573066B (en) * 2015-01-26 2017-11-03 中国工商银行股份有限公司 Page multiplexing method and device
CN105550194A (en) * 2015-08-31 2016-05-04 上海赞越软件服务中心 External different jq agency number crossing flow mechanism
CN106933890B (en) * 2015-12-31 2021-08-06 北京冠群信息技术股份有限公司 Method and device for processing static page
CN107798001B (en) * 2016-08-29 2022-03-22 菜鸟智能物流控股有限公司 Webpage processing method, device and equipment
CN106953765A (en) * 2017-03-31 2017-07-14 焦点科技股份有限公司 A kind of interconnection path run-off data generation and exhibiting method
CN109857473A (en) * 2017-11-29 2019-06-07 北京京东尚科信息技术有限公司 A kind of loading method and device of page data
CN109933736B (en) * 2019-03-08 2023-04-07 浪潮通用软件有限公司 Method and device for safely accessing JSP (Java Server Page) of third party and storage medium
CN110457616B (en) * 2019-07-24 2024-02-13 万达信息股份有限公司 Method for displaying web page consistency under heterogeneous CPU system
CN111580830B (en) * 2020-05-12 2023-09-15 北京飞漫软件技术有限公司 Binding and parsing method for hypertext markup language document element
CN113901359A (en) * 2021-10-09 2022-01-07 南京景凡软件技术有限公司 Webpage local dynamic refreshing method for embedded operating system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020004813A1 (en) * 2000-03-08 2002-01-10 Alok Agrawal Methods and systems for partial page caching of dynamically generated content
US20020130900A1 (en) * 2001-03-16 2002-09-19 Tomorrowsoft Corporation System for generating an interface for software applications in a client-server environment
WO2003067469A2 (en) * 2002-02-04 2003-08-14 Mobileaware Technologies Limited Document transformation
CN1555534A (en) * 2001-09-13 2004-12-15 �Ҵ���˾ Method and system for delivering dynamic information in a network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020004813A1 (en) * 2000-03-08 2002-01-10 Alok Agrawal Methods and systems for partial page caching of dynamically generated content
US20020130900A1 (en) * 2001-03-16 2002-09-19 Tomorrowsoft Corporation System for generating an interface for software applications in a client-server environment
CN1555534A (en) * 2001-09-13 2004-12-15 �Ҵ���˾ Method and system for delivering dynamic information in a network
WO2003067469A2 (en) * 2002-02-04 2003-08-14 Mobileaware Technologies Limited Document transformation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Building Rich Web Applications with Ajax. Linda Dailey Paulson.Computer,Vol.Vol.38 No.No.10. 2005
Building Rich Web Applications with Ajax. Linda Dailey Paulson.Computer,Vol.Vol.38 No.No.10. 2005 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510377A (en) * 2011-10-31 2012-06-20 北京锐安科技有限公司 Webpage interaction accelerating asynchronous data processing method and system

Also Published As

Publication number Publication date
CN1987850A (en) 2007-06-27

Similar Documents

Publication Publication Date Title
CN100437579C (en) Method for realizing AJAX webpage
KR101099272B1 (en) Web page rendering mechanism using external programmatic themes
US7581231B2 (en) Computing system and method for allowing plurality of applications written in different programming languages to communicate and request resources or services via a common language runtime layer
US8161498B2 (en) Providing globalization functionalities for javascript applications
CN102129364B (en) Method for embedding widget toolbar in application program and rapid widget accessing method
US7162687B2 (en) JSP tag libraries and web services
CN101216838B (en) XML interface configuration file distribute system and method based on WEB marker
US20020042831A1 (en) System and method for building applications that adapt for multiple device and protocol standards
US7673283B2 (en) Method and system for improved modeling language profile
CN104375808B (en) interface display method and device
CN105117234B (en) A kind of web control combination method
WO2011044692A1 (en) System and method for managing applications for multiple computing endpoints and multiple endpoint types
CN100465882C (en) Method and system of establishing culture sensitive control element for global application
CN101106578A (en) A method and system for changing interface subject
CN1316782C (en) Method for realizing tree-shaped structure in B/S structure
AU2004298636A1 (en) Method and system for creating and providing a multi-tier networked service
CN100492360C (en) Method and system for webpage generation
CN103530338A (en) Frame for carrying out page rendering on calculation equipment and page generation method
CN101147128A (en) Method to automate resource management in computer applications
US8756487B2 (en) System and method for context sensitive content management
Bandelloni et al. Dynamic generation of web migratory interfaces
KR20090000199A (en) Web server application framework, web application processing method using the framework and computer readable medium processing the method
JP2001125855A (en) Dynamic web page generation program
CN115994517A (en) Information processing method, apparatus, storage medium, device, and program product
JP2002351781A (en) Content generating device using screen display page layout

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant