Movatterモバイル変換


[0]ホーム

URL:


CN100437579C - Method for realizing AJAX webpage - Google Patents

Method for realizing AJAX webpage
Download PDF

Info

Publication number
CN100437579C
CN100437579CCNB2005101210667ACN200510121066ACN100437579CCN 100437579 CCN100437579 CCN 100437579CCN B2005101210667 ACNB2005101210667 ACN B2005101210667ACN 200510121066 ACN200510121066 ACN 200510121066ACN 100437579 CCN100437579 CCN 100437579C
Authority
CN
China
Prior art keywords
data
xml
html
client
webpage
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 LtdfiledCriticalTencent Technology Shenzhen Co Ltd
Priority to CNB2005101210667ApriorityCriticalpatent/CN100437579C/en
Publication of CN1987850ApublicationCriticalpatent/CN1987850A/en
Application grantedgrantedCritical
Publication of CN100437579CpublicationCriticalpatent/CN100437579C/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Landscapes

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

Translated fromChinese
一种实现AJAX网页的方法A Method of Realizing AJAX Webpage

技术领域technical field

本发明涉及网络技术,具体涉及AJAX网页技术,更具体地说,涉及一种实现AJAX网页的方法。The present invention relates to network technology, in particular to AJAX web page technology, more specifically, to a method for realizing AJAX web page.

背景技术Background technique

随着互联网的不断发展,传统的动态网页开发技术已经为许多网页制作人员所熟悉。近年来,丰富互联网应用程序(Rich Internet Application,简称RIA)开发模式的兴起使互联网用户对网络交互感受提出了更高的要求,传统的技术已经无法满足RIA开发的需要,而AJAX(Asynchronous JavaScriptand XML,简称AJAX)开始成为主流的RIA开发模式。AJAX是一个结合了DHTML技术、XML(可扩展标记语言,eXtensible Markup Language)以及JavaScript的等编程技术。AJAX并不是一门新的语言或技术,它实际上是几项技术按一定的方式组合在一起在共同的协作中发挥各自的作用。AJAX是使用客户端脚本与网页服务器交换数据的网页应用开发方法。这样,网页页面不用打断交互流程进行重新加载,就可以动态地更新。AJAX网页的一个最大的特点是无需刷新页面便可向服务器传输或读写数据(又称为无刷新更新页面)。With the continuous development of the Internet, the traditional dynamic web page development technology has become familiar to many web page producers. In recent years, the rise of Rich Internet Application (RIA for short) development mode has made Internet users put forward higher requirements for network interaction experience. Traditional technology can no longer meet the needs of RIA development, and AJAX (Asynchronous JavaScript and XML , referred to as AJAX) began to become the mainstream RIA development model. AJAX is a programming technology that combines DHTML technology, XML (Extensible Markup Language, eXtensible Markup Language) and JavaScript. AJAX is not a new language or technology, it is actually several technologies combined in a certain way to play their respective roles in common collaboration. AJAX is a web application development method that uses client-side scripts to exchange data with web servers. In this way, web pages can be dynamically updated without interrupting the interactive flow for reloading. One of the biggest features of AJAX web pages is that they can transmit or read and write data to the server without refreshing the page (also known as updating pages without refreshing).

传统的ASP(Active Server Pages,活动服务器网页)/JSP(Java ServerPages)动态网页开发模式是通过服务器解析其约定的标记实现了动态网页生成和数据展现,在数据发生变化时通过页面刷新来更新新展现的数据。在这种交互方式下,由用户触发一个HTTP请求到服务器,每当服务器处理客户端提交的请求时,服务器需要完整地解析页面并生成HTML代码在页面中展现,但是用户只能空闲等待,并且一次很小的交互或需从服务器端得到一个很简单的数据,都要返回一个完整的HTML页面,浪费了时间和带宽去重新读取整个页面。因此,消耗了过多的服务器资源和网络带宽资源,影响了服务器与用户交互的速度,破坏了用户的交互感受。The traditional ASP (Active Server Pages, Active Server Pages)/JSP (Java Server Pages) dynamic web page development model implements dynamic web page generation and data display through server parsing of its agreed tags, and updates the new page by refreshing the page when the data changes. displayed data. In this interactive mode, the user triggers an HTTP request to the server. Whenever the server processes the request submitted by the client, the server needs to completely parse the page and generate HTML code to display on the page, but the user can only wait idle, and A small interaction or a very simple data from the server must return a complete HTML page, wasting time and bandwidth to re-read the entire page. Therefore, excessive server resources and network bandwidth resources are consumed, which affects the speed of interaction between the server and the user, and destroys the user's interactive experience.

现有的实现AJAX模式一般通过以下3种方式来实现:The existing AJAX mode is generally implemented in the following three ways:

(1)AJAX可以利用Javascript脚本技术来控制浏览器内置的XML控件,从而实现AJAX页面无刷新的动态数据展现。如果采用在每个页面中编写脚本解析XML数据并展现在页面中,这种实现AJAX的开发模式会带来非常大的前台页面的开发工作;如果由后台返回完整的XML文件后用脚本(利用控件)解析xml后生成html代码再灌回页面的层中,这种实现AJAX的开发模式也会带来非常大的后台程序的耦合,并且导致后台XML数据难以重用和缓存。(1) AJAX can use Javascript script technology to control the built-in XML control of the browser, so as to realize the display of dynamic data without refreshing the AJAX page. If you use scripts to parse XML data in each page and display them in the page, this development mode for implementing AJAX will bring a very large development work for the front page; if the complete XML file is returned from the background, use the script (using Control) generates html code after parsing xml and pours it back into the layer of the page. This development mode of implementing AJAX will also bring a very large background program coupling, and make it difficult to reuse and cache the background XML data.

(2)ZK包括一个基于AJAX可自动进行交互式操作的事件驱动引擎和一套兼容XUL的组件,可以用具有XUL特性的组件来表示应用程序并通过由用户触发的监听事件来操作这些组件,从而实现AJAX页面无刷新的动态数据展现。但是,这种实现AJAX的开发模式带来的是XUL这个技术门槛,并且只能将后台绑定在了J2EE服务器,限制了AJAX技术的应用范围。(2) ZK includes an AJAX-based event-driven engine that can automatically perform interactive operations and a set of XUL-compatible components. You can use components with XUL features to represent applications and operate these components through listening events triggered by users. In order to realize the dynamic data display without refreshing the AJAX page. However, this development mode of implementing AJAX brings the technical threshold of XUL, and can only bind the background to the J2EE server, which limits the application range of AJAX technology.

(3)Google AJAXSL(http://goog-ajaxslt.sourceforge.net),是一个Javascript框架,用来执行XSLT转换以及XPath查询,从而实现AJAX页面无刷新的动态数据展现。目前在Google Map就使用了此技术。但是,这种实现AJAX的开发模式也带来XSLT这个技术门槛,并且提高了网页开发人员的学习曲线,增加了网页开发的复杂度。(3) Google AJAXSL (http://goog-ajaxslt.sourceforge.net), is a Javascript framework, used to perform XSLT conversion and XPath query, so as to realize the dynamic data display of AJAX pages without refreshing. This technology is currently used in Google Maps. However, this development mode of implementing AJAX also brings the technical threshold of XSLT, and improves the learning curve of web page developers, increasing the complexity of web page development.

发明内容Contents of the invention

本发明要解决的技术问题在于,针对现有技术的上述传统的ASP/JSP页面交互效率低、用户感受差以及当前AJAX的开发技术复杂等缺陷,提供一种基于自定义标记网页利用标记引擎脚本实现AJAX网页的方法。The technical problem to be solved by the present invention is that, aiming at the above-mentioned traditional ASP/JSP page interaction efficiency of the prior art is low, the user experience is poor and the development technology of current AJAX is complicated, etc., to provide a webpage based on self-defined markup using a markup engine script A method for implementing AJAX web pages.

本发明解决其技术问题所采用的技术方案是:构造一种实现AJAX网页的方法,包括以下步骤:The technical scheme that the present invention solves its technical problem adopts is: construct a kind of method that realizes AJAX webpage, comprise the following steps:

S1.服务器接收到客户端的请求后向所述客户端返回所述请求的网页,该网页设有标记引擎脚本;S1. After receiving the client's request, the server returns the requested webpage to the client, and the webpage is provided with a markup engine script;

S2.所述服务器根据所述网页与用户的交互信息向所述客户端返回XML数据;S2. The server returns XML data to the client according to the interaction information between the web page and the user;

S3.所述标记引擎脚本将所述XML数据解析为HTML数据。S3. The markup engine script parses the XML data into HTML data.

在本发明所述网页上使用自定义标记。Use of custom tags on web pages described herein.

在本发明在步骤S1之前,还包括:Before the step S1 of the present invention, it also includes:

根据前后台数据接口约定,确定XML模板;Determine the XML template according to the front-end and back-end data interface agreements;

根据所述XML模板开发后台程序;Develop a background program according to the XML template;

采用自定义标记设计网页并通过标记引擎脚本加载XML模板数据;Design web pages with custom tags and load XML template data through tag engine scripts;

在服务器与客户端连调时,用动态XML数据替换设计过程中所使用的XML模板数据。When the server is connected with the client, the XML template data used in the design process is replaced with dynamic XML data.

步骤S3中所述将所述XML数据解析为HTML数据具体包括:The parsing of the XML data into HTML data described in step S3 specifically includes:

S31.调用所述标记引擎脚本接收所述XML数据并判断网页是否初次进行标记解析,如果是,则执行步骤S32,如果不是,则执行步骤S33;S31. Call the markup engine script to receive the XML data and judge whether the webpage is performing markup parsing for the first time, if yes, execute step S32, if not, execute step S33;

S32.通过浏览器提供的应用编程接口(Application ProgrammingInterface简称API)获得网页的HTML代码并保存原始的HTML代码;S32. Obtain the HTML code of the web page and save the original HTML code through the application programming interface (Application Programming Interface referred to as API) provided by the browser;

S33.取回上次解析前的原始HTML代码;S33. Get back the original HTML code before the last analysis;

S34.用递归算法分析获得所述HTML代码并逐层分解出其中的自定义标记;S34. Using a recursive algorithm to analyze and obtain the HTML code and decompose the custom tags therein layer by layer;

S35.根据逐层分解出的所述自定义标记找出所述HTML代码中需要使用的循环、判断和替换逻辑以及所述使用的循环、判断和替换逻辑与所述XML数据之间的映射关系;S35. Find out the loop, judgment and replacement logic that needs to be used in the HTML code and the mapping relationship between the used loop, judgment and replacement logic and the XML data according to the custom tags decomposed layer by layer ;

S36.通过逐层递归用所述XML数据填充需要替换的所述自定义标记,生成最终的HTML代码;S36. Filling the custom tags to be replaced with the XML data recursively layer by layer to generate final HTML codes;

S37.通过浏览器提供的API接口将所述生成的HTML代码返回到客户端。S37. Return the generated HTML code to the client through the API interface provided by the browser.

在本发明所述标记引擎脚本是用JavaScript脚本编写。The markup engine script in the present invention is written in JavaScript script.

在本发明所述步骤S2中,所述交互信息是用户请求动态展现网页内容信息或用户输入的数据信息。In the step S2 of the present invention, the interaction information is the user's request to dynamically display the content information of the webpage or the data information input by the user.

本发明中所述自定义标记用于控制页面解析逻辑。The custom tags described in the present invention are used to control page parsing logic.

在本发明所述自定义标记是ASP/JSP标记。In the present invention, the custom tags are ASP/JSP tags.

实施本发明方法的有益效果是,允许网页开发人员采用传统的页面标记技术开发AJAX动态页面,减少了开发工作量,提高了软件的可靠性,带来更好的用户体验,进一步促进页面展现和数据的分离。The beneficial effect of implementing the method of the present invention is to allow webpage developers to develop AJAX dynamic pages using traditional page marking technology, which reduces the development workload, improves the reliability of the software, brings better user experience, and further promotes page display and Separation of data.

附图说明Description of drawings

下面将结合附图及实施例,对本发明作进一步说明,附图中:Below in conjunction with accompanying drawing and embodiment, the present invention will be further described, and in accompanying drawing:

图1是利用本发明方法实现AJAX网页的流程图;Fig. 1 is the flow chart that utilizes the inventive method to realize AJAX web page;

图2是利用本发明方法实现AJAX网页的结构框图;Fig. 2 is the structural block diagram that utilizes the inventive method to realize AJAX web page;

图3是利用本发明方法的标记引擎脚本的实现流程图。Fig. 3 is an implementation flow chart of a markup engine script using the method of the present invention.

具体实施方式Detailed ways

传统的ASP与JSP技术非常相似,两者都提供在HTML代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。在ASP或JSP环境下,HTML代码主要负责描述信息的显示样式,而程序代码则用来描述处理逻辑。普通的HTML页面只依赖于Web服务器,而ASP和JSP页面需要附加的语言引擎分析和执行程序代码。程序代码的执行结果被重新嵌入到HTML代码中,然后一起发送给客户端浏览器。ASP和JSP都是面向Web服务器的技术,客户端浏览器不需要任何附加的软件支持。Traditional ASP and JSP technologies are very similar, both of which provide the ability to mix some kind of program code in HTML code, and the language engine interprets and executes the program code. In the ASP or JSP environment, the HTML code is mainly responsible for describing the display style of the information, while the program code is used to describe the processing logic. Ordinary HTML pages only depend on the Web server, while ASP and JSP pages require additional language engines to analyze and execute program codes. The execution result of the program code is re-embedded into the HTML code, and then sent to the client browser together. Both ASP and JSP are Web server-oriented technologies, and the client browser does not require any additional software support.

传统的ASP网页包含HTML标记、普通文本、VB Script或Jscript脚本程序代码以及COM组件等,其文件扩展名是.asp而不是.html或.htm。当客户端浏览器浏览ASP网页时,服务器根据接收到该ASP页面的请求,通过ASP.DLL文件将ASP文件从头至尾被解析执行并根据命令要求生成响应的HTML页面送回给客户端浏览器,这样客户端浏览器看到的就是动态生成的网页。Traditional ASP web pages include HTML tags, ordinary text, VB Script or Jscript script code, and COM components, etc., and their file extensions are .asp instead of .html or .htm. When the client browser browses the ASP web page, the server will parse and execute the ASP file from beginning to end through the ASP. , so that the client browser sees the dynamically generated web page.

传统的JSP页面实际上是一个带有传统HTML标记和Java代码的Web页面。JSP页面的文件扩展名是.jsp。当客户端浏览器浏览JSP网页时,服务器根据接收到该JSP页面的请求,通过JSP引擎将该JSP文件转变成一个纯Java的Servlet,然后将其编译成Servlet字节代码,这个Servlet可以调用其他的Servlet或JavaBeans,最后将Servlet的执行结果HTML页面送回给客户端浏览器,这样客户端浏览器看到的就是动态生成的网页。A traditional JSP page is actually a web page with traditional HTML markup and Java code. The file extension for a JSP page is .jsp. When the client browser browses a JSP webpage, the server converts the JSP file into a pure Java Servlet through the JSP engine according to the request received from the JSP page, and then compiles it into Servlet byte code. This Servlet can call other Servlet or JavaBeans, and finally send the HTML page of the execution result of the Servlet back to the client browser, so that the client browser sees the dynamically generated webpage.

因此,正如背景技术提到的,用户与页面进行交互时,服务器端每次都要返回一个完整的HTML页,这样,用户每次都要浪费时间和带宽去重新读取整个页面,消耗了过多的服务器资源和网络带宽资源,影响了服务器与用户交互的速度,破坏了用户的交互感受。Therefore, as mentioned in the background technology, when the user interacts with the page, the server will return a complete HTML page every time, so that the user will waste time and bandwidth to re-read the entire page every time, consuming too much time and effort. Too many server resources and network bandwidth resources affect the speed of interaction between the server and the user, and destroy the user's interactive experience.

针对上述情况,本发明利用标记引擎脚本实现基于自定义标记开发模式的AJAX网页。自定义标记指用于控制页面解析逻辑的,浏览器无法自行解析的,传统上由服务器解析的页面标记,自定义标记可以是传统ASP/JSP标记,也可以是其它服务器页面标记,本发明的实现过程如图1、图2所示,In view of the above situation, the present invention utilizes the markup engine script to realize the AJAX webpage based on the self-defined markup development mode. Custom tags refer to those used to control the page parsing logic, which cannot be parsed by the browser by itself, and are traditionally parsed by the server. The custom tags can be traditional ASP/JSP tags or other server page tags. The present invention The implementation process is shown in Figure 1 and Figure 2.

S1.服务器接收到客户端的请求后向所述客户端返回所述请求的网页,该网页设有标记引擎脚本(步骤100中);S1. After receiving the client's request, the server returns the requested webpage to the client, and the webpage is provided with a markup engine script (in step 100);

S2.所述服务器根据所述网页与用户的交互信息向所述客户端返回XML数据(步骤102中);S2. The server returns XML data to the client according to the interaction information between the webpage and the user (in step 102);

S3.所述标记引擎脚本将所述XML数据解析为HTML数据(步骤104中)。下面以传统ASP/JSP标记为例对实现AJAX网页的开发过程进行描述。S3. The markup engine script parses the XML data into HTML data (in step 104). The following describes the development process of implementing AJAX web pages by taking traditional ASP/JSP tags as an example.

首先,网页前台开发人员和后台服务程序开发人员在开发AJAX网页时,需要协商约定前后台的数据接口,可以用实例数据的形式设计出XML数据的模板。XML与HTML类似,它是一种使用标签的标记语言,为数据描述提供了独立于平台和应用程序的格式。尽管XML和HTML都使用标记,但是它们是不同的,HTML是把数据和显示融合在一起的,不可分离,而XML则可以把数据和显示分离,即使用HTML进行显示,把数据放在XML中。这样,在不同的平台上显示什么样的网页,是HTML的事情,放在.htm或.html文件中,而数据是不变的,都存放在.xml文件中。后台开发人员则可以根据上述XML模板的约定开发后台程序。First of all, when developing AJAX web pages, front-end developers and background service program developers need to negotiate and agree on the front-end and back-end data interfaces, and can design XML data templates in the form of instance data. XML, like HTML, is a markup language that uses tags to provide a platform- and application-independent format for data description. Although both XML and HTML use tags, they are different. HTML integrates data and display and cannot be separated, while XML can separate data and display, that is, use HTML for display and put data in XML. . In this way, what kind of webpages are displayed on different platforms is a matter of HTML, and they are placed in .htm or .html files, while the data remains unchanged and are all stored in .xml files. Background developers can develop background programs according to the agreement of the above XML template.

而前台开发人员就可以采用传统的ASP/JSP标记开发技术设计网页,完成基本页面的功能设计后,就开始创建XML文档。XML文档包含了一整套对应于HTML页面的字符串。为了将.xml文件中的数据赋值给变量,并将变量值插入到HTML流中,就需要在ASP/JSP页面中插入标记引擎脚本,通过标记引擎脚本加载XML模板数据,并将XML数据转换为普通的HTML内容,即使是早期版本的浏览器也支持XML,同样能够看到这些动态网页内容。The front-end developers can use the traditional ASP/JSP tag development technology to design web pages, and after completing the functional design of the basic pages, they can start to create XML documents. An XML document contains a set of strings corresponding to an HTML page. In order to assign the data in the .xml file to the variable and insert the variable value into the HTML stream, it is necessary to insert the markup engine script into the ASP/JSP page, load the XML template data through the markup engine script, and convert the XML data into Ordinary HTML content, even early versions of browsers that support XML, can also see these dynamic web content.

标记引擎脚本的实现过程如图3所示,调用所述标记引擎脚本接收所述XML数据(步骤300中),并判断网页是否初次进行标记解析(步骤302中),如果是,则通过浏览器提供的API接口获得网页的HTML代码(步骤304中),并保存原始的HTML代码(步骤306中),如果不是,则取回上次解析前的原始HTML代码(步骤308中);然后用递归算法分析获得的所述HTML代码并逐层分解出其中的ASP/JSP标记(步骤310中);根据逐层分解出的所述ASP/JSP标记找出所述HTML代码中需要使用的循环、判断和替换逻辑以及所述使用的循环、判断和替换逻辑与所述XML数据之间的映射关系(步骤312中);通过逐层递归用所述XML数据填充需要替换的所述ASP/JSP标记,生成最终的HTML代码(步骤314中);通过浏览器提供的API接口将所述生成的HTML代码回写到页面上(步骤316中)。因此,用户通过客户端浏览器控件与静态页面进行交互时,服务器只需返回用户所请求的那部分页面XML数据,而不是返回整个页面的HTML数据,避免了在网络上发送那些没有改变的页面信息,实现了能在不刷新整个页面的前提下便可向服务器传输或读写数据维护数据。当服务器返回XML数据到静态页面上时,静态页面即可以调用标记引擎脚本将其解析为HTML数据以实现向用户展现动态网页内容。最后,前后台开发人员在服务器与客户端连调时,用动态XML数据替换设计过程中所使用的XML模板数据,这样就可完成了AJAX网页的开发。将运用了异步数据加载技术、XML以及JavaScript的等编程技术的网页称为AJAX网页。The implementation process of the markup engine script is as shown in Figure 3, calls the markup engine script to receive the XML data (in step 300), and judges whether the webpage carries out mark analysis (in step 302) for the first time, if yes, then through the browser The provided API interface obtains the HTML code (in step 304) of webpage, and preserves original HTML code (in step 306), if not, then gets back the original HTML code (in step 308) before parsing last time; Then use recursion The described HTML code that algorithm analysis obtains and decomposes wherein ASP/JSP label (in step 310) layer by layer; And replacement logic and the mapping relationship between the used loop, judgment and replacement logic and the XML data (in step 312); recursively filling the ASP/JSP tags that need to be replaced with the XML data layer by layer, Generate the final HTML code (in step 314); write back the generated HTML code to the page through the API interface provided by the browser (in step 316). Therefore, when the user interacts with the static page through the client browser control, the server only needs to return the XML data of the part of the page requested by the user, instead of returning the HTML data of the entire page, avoiding sending those unchanged pages on the network Information, which realizes the ability to transmit or read and write data to the server and maintain data without refreshing the entire page. When the server returns the XML data to the static page, the static page can call the markup engine script to parse it into HTML data to display dynamic web content to the user. Finally, the front-end and back-end developers replace the XML template data used in the design process with dynamic XML data when the server and the client are connected, so that the development of the AJAX web page can be completed. A web page using programming technologies such as asynchronous data loading technology, XML, and JavaScript is called an AJAX web page.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of the present invention. within the scope of protection.

Claims (8)

Translated fromChinese
1、一种实现AJAX网页的方法,其特征在于,包括以下步骤:1. A method for realizing an AJAX webpage, comprising the following steps:S1.服务器接收到客户端的请求后向所述客户端返回所述请求的网页,该网页设有标记引擎脚本;S1. After receiving the client's request, the server returns the requested webpage to the client, and the webpage is provided with a markup engine script;S2.所述服务器根据所述网页与用户的交互信息向所述客户端返回XML数据;S2. The server returns XML data to the client according to the interaction information between the web page and the user;S3.所述标记引擎脚本将所述XML数据解析为HTML数据。S3. The markup engine script parses the XML data into HTML data.2、根据权利要求1所述的方法,其特征在于,所述网页上使用自定义标记。2. The method according to claim 1, wherein a custom mark is used on the web page.3、根据权利要求2所述的方法,其特征在于,在步骤S1之前,还包括:3. The method according to claim 2, characterized in that, before step S1, further comprising:根据前后台数据接口约定,确定XML模板;Determine the XML template according to the front-end and back-end data interface agreements;根据所述XML模板开发后台程序;Develop a background program according to the XML template;采用自定义标记设计网页并通过标记引擎脚本加载XML模板数据;Design web pages with custom tags and load XML template data through tag engine scripts;在服务器与客户端连调时,用动态XML数据替换设计过程中所使用的XML模板数据。When the server is connected with the client, the XML template data used in the design process is replaced with dynamic XML data.4、根据权利要求3所述的方法,其特征在于,步骤S3中所述将所述XML数据解析为HTML数据具体包括:4. The method according to claim 3, characterized in that, parsing the XML data into HTML data in step S3 specifically comprises:S31.调用所述标记引擎脚本接收所述XML数据并判断网页是否初次进行标记解析,如果是,则执行步骤S32,如果不是,则执行步骤S33;S31. Call the markup engine script to receive the XML data and judge whether the webpage is performing markup parsing for the first time, if yes, execute step S32, if not, execute step S33;S32.通过浏览器提供的应用编程接口获得网页的HTML代码并保存原始的HTML代码;S32. Obtain the HTML code of the webpage through the application programming interface provided by the browser and save the original HTML code;S33.取回上次解析前的原始HTML代码;S33. Get back the original HTML code before the last analysis;S34.用递归算法分析获得所述HTML代码并逐层分解出其中的自定义标记;S34. Using a recursive algorithm to analyze and obtain the HTML code and decompose the custom tags therein layer by layer;S35.根据逐层分解出的所述自定义标记找出所述HTML代码中需要使用的循环、判断和替换逻辑以及所述使用的循环、判断和替换逻辑与所述XML数据之间的映射关系;S35. Find out the loop, judgment and replacement logic that needs to be used in the HTML code and the mapping relationship between the used loop, judgment and replacement logic and the XML data according to the custom tags decomposed layer by layer ;S36.通过逐层递归用所述XML数据填充需要替换的所述自定义标记,生成最终的HTML代码;S36. Filling the custom tags to be replaced with the XML data recursively layer by layer to generate final HTML codes;S37.通过浏览器提供的应用编程接口将所述生成的HTML代码返回到客户端。S37. Return the generated HTML code to the client through the application programming interface provided by the browser.5、根据权利要求1所述的方法,其特征在于,所述步骤S2中,所述交互信息是用户请求动态展现网页内容信息或用户输入的数据信息。5. The method according to claim 1, characterized in that, in the step S2, the interactive information is a user request to dynamically display web page content information or data information input by the user.6、根据权利要求1-5任意一条所述的方法,其特征在于,所述标记引擎脚本是用JavaScript脚本编写。6. The method according to any one of claims 1-5, wherein the markup engine script is written in JavaScript.7、根据权利要求2-4任意一条所述的方法,其特征在于,所述自定义标记用于控制页面解析逻辑。7. The method according to any one of claims 2-4, wherein the custom tag is used to control page parsing logic.8、根据权利要求7所述的方法,其特征在于,所述自定义标记是ASP/JSP标记。8. The method according to claim 7, wherein the self-defined tag is an ASP/JSP tag.
CNB2005101210667A2005-12-202005-12-20Method for realizing AJAX webpageActiveCN100437579C (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CNB2005101210667ACN100437579C (en)2005-12-202005-12-20Method for realizing AJAX webpage

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CNB2005101210667ACN100437579C (en)2005-12-202005-12-20Method for realizing AJAX webpage

Publications (2)

Publication NumberPublication Date
CN1987850A CN1987850A (en)2007-06-27
CN100437579Ctrue CN100437579C (en)2008-11-26

Family

ID=38184649

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CNB2005101210667AActiveCN100437579C (en)2005-12-202005-12-20Method for realizing AJAX webpage

Country Status (1)

CountryLink
CN (1)CN100437579C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102510377A (en)*2011-10-312012-06-20北京锐安科技有限公司Webpage interaction accelerating asynchronous data processing method and system

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101122921B (en)*2007-09-212011-09-28北京意科通信技术有限责任公司Method forming tree-shaped display structure based on ajax and html
CN101442515B (en)*2007-11-222011-09-07深圳市科陆电子科技股份有限公司Remote control method based on browser
DE502008000597D1 (en)2008-01-092010-06-10Rp Technik E K Microcontroller-controlled emergency lighting system and suitable communication method therefor
CN101610195B (en)*2008-06-172011-10-26上海格尔软件股份有限公司Method for AJAX cross-domain synchronous transmission of high volume data
CN101610194B (en)*2008-06-172011-11-23上海格尔软件股份有限公司Method for AJAX cross-domain asynchronous transmission of high volume data
CN101609399B (en)*2008-06-202013-07-03鸿富锦精密工业(深圳)有限公司Intelligent website development system based on modeling and method thereof
CN102253946A (en)*2010-05-202011-11-23腾讯科技(北京)有限公司Lua script interactive information-based method, Web engine and embedded terminal
CN102075572B (en)*2010-12-292013-05-01北京遥测技术研究所Embedded type web server
CN102279862A (en)*2011-05-102011-12-14中兴通讯股份有限公司Data processing device and method based on Ajax
CN102184266B (en)*2011-06-272012-08-29武汉大学Method for automatically generating dynamic wireless application protocol (WAP) website for separation of page from data
CN102355449B (en)*2011-06-302014-09-17深信服网络科技(深圳)有限公司Method, gateway and system for implicitly transmitting reorientation request
CN103139260B (en)2011-11-302015-09-30国际商业机器公司For reusing the method and system of HTML content
CN102571934A (en)*2011-12-222012-07-11深圳华强电子交易网络有限公司WEB page data binding method
CN103778117B (en)*2012-10-172018-11-09腾讯科技(深圳)有限公司A kind of method and system of information of mobile terminal load
CN103347081B (en)*2013-07-102016-08-31中国建设银行股份有限公司The requesting method of a kind of self-defined page and system
CN104462090A (en)*2013-09-132015-03-25方正信息产业控股有限公司Method and device for processing data
CN104461513B (en)*2014-11-212018-01-09山东航天信息有限公司A kind of method and device for generating form interface
CN104378446A (en)*2014-12-022015-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-262017-11-03中国工商银行股份有限公司Page multiplexing method and device
CN105550194A (en)*2015-08-312016-05-04上海赞越软件服务中心External different jq agency number crossing flow mechanism
CN106933890B (en)*2015-12-312021-08-06北京冠群信息技术股份有限公司Method and device for processing static page
CN107798001B (en)*2016-08-292022-03-22菜鸟智能物流控股有限公司Webpage processing method, device and equipment
CN106953765A (en)*2017-03-312017-07-14焦点科技股份有限公司 A method for generating and displaying Internet path traffic data
CN109857473A (en)*2017-11-292019-06-07北京京东尚科信息技术有限公司A kind of loading method and device of page data
CN109933736B (en)*2019-03-082023-04-07浪潮通用软件有限公司Method and device for safely accessing JSP (Java Server Page) of third party and storage medium
CN110457616B (en)*2019-07-242024-02-13万达信息股份有限公司Method for displaying web page consistency under heterogeneous CPU system
CN111580830B (en)*2020-05-122023-09-15北京飞漫软件技术有限公司Binding and parsing method for hypertext markup language document element
CN112163177B (en)*2020-09-102025-02-14上海连尚网络科技集团有限公司 Web game processing method, electronic device and computer readable storage medium
CN113901359A (en)*2021-10-092022-01-07南京景凡软件技术有限公司Webpage local dynamic refreshing method for embedded operating system
CN114357333B (en)*2021-12-302025-08-12紫光云(南京)数字技术有限公司Low-cost front-end project upgrading method

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20020004813A1 (en)*2000-03-082002-01-10Alok AgrawalMethods and systems for partial page caching of dynamically generated content
US20020130900A1 (en)*2001-03-162002-09-19Tomorrowsoft CorporationSystem for generating an interface for software applications in a client-server environment
WO2003067469A2 (en)*2002-02-042003-08-14Mobileaware Technologies LimitedDocument transformation
CN1555534A (en)*2001-09-132004-12-15�Ҵ���˾Method and system for delivering dynamic information in a network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20020004813A1 (en)*2000-03-082002-01-10Alok AgrawalMethods and systems for partial page caching of dynamically generated content
US20020130900A1 (en)*2001-03-162002-09-19Tomorrowsoft CorporationSystem for generating an interface for software applications in a client-server environment
CN1555534A (en)*2001-09-132004-12-15�Ҵ���˾Method and system for delivering dynamic information in a network
WO2003067469A2 (en)*2002-02-042003-08-14Mobileaware Technologies LimitedDocument transformation

Non-Patent Citations (1)

* 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*

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102510377A (en)*2011-10-312012-06-20北京锐安科技有限公司Webpage interaction accelerating asynchronous data processing method and system

Also Published As

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

Similar Documents

PublicationPublication DateTitle
CN100437579C (en)Method for realizing AJAX webpage
JP4643931B2 (en) Web page rendering mechanism using themes based on external programs
Brown et al.Implementation patterns for microservices architectures
US8954989B1 (en)Flexible, event-driven JavaScript server architecture
CN102184266A (en)Method for automatically generating dynamic wireless application protocol (WAP) website for separation of page from data
US9122650B1 (en)Web server based on the same paradigms as web clients
US20080082965A1 (en)Providing globalization functionalities for javascript applications
CN111913705B (en)JavaScript template implementation method based on difference updating algorithm
CN100433013C (en)Method and system for demonstrating data by tree-mode structure
US7096455B2 (en)Method and system for representing and accessing data for computer software applications
EP1399841A1 (en)System & method of mapping between software objects & structured language element-based documents
US20090019432A1 (en)Generating A Dynamic Content Creation Program
US7533117B2 (en)Component-based adaptation system and method
US20160012147A1 (en)Asynchronous Initialization of Document Object Model (DOM) Modules
US20160012144A1 (en)Javascript-based, client-side template driver system
CN113010170A (en)Page rendering method, device, medium and electronic equipment based on Vue3 component
US8756487B2 (en)System and method for context sensitive content management
Suzuki et al.Managing the software design documents with XML
US20160012023A1 (en)Self-Referencing of Running Script Elements in Asynchronously Loaded DOM Modules
CN100512115C (en)Method and system for providing service to user
US9727397B2 (en)Container-less JSP template
LaykaLearn java for web development: Modern java web development
Zdun et al.Content conversion and generation on the web: A pattern language
Kao et al.Designing an XML-based context-aware transformation framework for mobile execution environments using CC/PP and XSLT
KR100427681B1 (en)A method and apparatus defining a component model for creating dynamic document in a distributed data processing system

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp