CN105528369B - Webpage code-transferring method, device and server - Google Patents
Webpage code-transferring method, device and server Download PDFInfo
- Publication number
- CN105528369B CN105528369B CN201410522095.3A CN201410522095A CN105528369B CN 105528369 B CN105528369 B CN 105528369B CN 201410522095 A CN201410522095 A CN 201410522095A CN 105528369 B CN105528369 B CN 105528369B
- Authority
- CN
- China
- Prior art keywords
- page
- transcoding
- webpage
- original web
- javascript
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a kind of webpage code-transferring method, device and servers, this method comprises: when receiving browser and needing user to click in the page after first time transcoding to be clicked to execute the element of JavaScript, the web-page requests including webpage information sent, wherein, webpage information include position of the element in the original web page of the page, the page original web page uniform resource locator;According to the original web page of uniform resource locator loading page, and according to position in original web page location element, and generate click event to element and obtain corresponding webpage to execute JavaScript, corresponding webpage is subjected to second of transcoding;The page after second of transcoding is sent to browser, the page after second of transcoding is shown so as to browser.By the above-mentioned means, the present invention can guarantee that user is needed to click to execute the webpage function of the element of JavaScript in the normal use of client.
Description
Technical field
The present invention relates to mobile internet technical fields, more particularly to a kind of webpage code-transferring method, device and service
Device.
Background technique
The rise of mobile Internet makes mobile phone user gradually form the habit with mobile phone access internet.But due to tradition
Interface and the style for interconnecting the website WEB, are to design for personal computer screen, even if being mounted with to read on mobile phone super
The browser of text mark up language (HyperText Markup Language, be abbreviated as HTML) formatted webpages, these webpages
The effect that (i.e. original web page) is shown on mobile phone screen is still difficult to see.
In the prior art, by these original web pages by transcoding server carry out transcoding (including compression html, modification cascade
The means such as style sheet (Cascading Style Sheets, be abbreviated as CSS), compressed picture) after, can have on mobile phone more preferable
Result of browse, and save flow.Traditional transcoding process includes: first, obtains original web page html;Second, parse document
Object model (Document Object Model, be abbreviated as DOM) tree;Third executes JavaScript (abbreviation JS);4th,
Dom tree is converted into output html.Transcoding server load and parsing original web page, execute the JavaScript in original web page,
Then parent page transcoding is exported.
But due to after original web page transcoding html code and structure vary widely, the transcoding page is not supported original
Webpage is some to need user to click the JavaScript being just triggered, this causes the missing of webpage function.
Summary of the invention
The invention mainly solves the technical problem of providing a kind of webpage code-transferring method, device and server, Neng Goubao
Card needs user to click to execute the webpage function of the element of JavaScript in the normal use of client.
In order to solve the above technical problems, one technical scheme adopted by the invention is that: browser is received in first time transcoding
When needing user to click in the page afterwards to be clicked to execute the element of JavaScript, the webpage including webpage information of transmission is asked
It asks, wherein the webpage information includes the original net of position of the element in the original web page of the page, the page
The uniform resource locator of page;The original web page of the page is loaded according to the uniform resource locator, and according to described
Position positions the element in the original web page, and generates and obtained to the click event of the element with executing JavaScript
To corresponding webpage, the corresponding webpage is subjected to second of transcoding;The page after second of transcoding is sent to the browser,
The page after showing second of transcoding so as to the browser.
Wherein, the webpage information is server during carrying out first time transcoding to original web page, monitors to need
User is wanted to click to execute and generate when the element of JavaScript.
Wherein, position of the element in the original web page is with XPath language tag.
Wherein, the element include have onclick attribute element or have href attribute and with
The element of " javascript: " beginning.
In order to solve the above technical problems, another technical solution used in the present invention is: providing another webpage transcoding side
Method, which comprises need user to click in page after first time transcoding to execute the element of JavaScript and be clicked,
The web-page requests including webpage information then are sent to server, wherein the webpage information includes the element in the page
Original web page in position, the page original web page uniform resource locator;It receives described in the server response
Web-page requests and the page after second of transcoding returning, wherein the page after second of transcoding is the server root
The original web page of the page is loaded according to the uniform resource locator, and fixed in the original web page according to the position
The position element generates the click event to the element to execute JavaScript and obtain corresponding webpage, and will be described right
Webpage is answered to carry out what transcoding obtained;The page after showing second of transcoding.
In order to solve the above technical problems, another technical solution that the present invention uses is: providing a kind of server, the clothes
Business device includes: receiving module, needs user to click to execute in the page after first time transcoding for receiving browser
When the element of JavaScript is clicked, the web-page requests including webpage information of transmission, wherein the webpage information includes institute
State position of the element in the original web page of the page, the page original web page uniform resource locator;Execute mould
Block, for loading the original web page of the page according to the uniform resource locator, and according to the position in the original
The element is positioned in beginning webpage, and is generated the click event to the element and obtained corresponding webpage to execute JavaScript,
The corresponding webpage is subjected to second of transcoding;Sending module, for the page after second of transcoding to be sent to the browsing
Device, the page after second of transcoding is shown so as to the browser.
Wherein, the webpage information is server during carrying out first time transcoding to original web page, monitors to need
User is wanted to click to execute and generate when the element of JavaScript.
Wherein, position of the element in the original web page is with XPath language tag.
Wherein, the element include have onclick attribute element or have href attribute and with
The element of " javascript: " beginning.
In order to solve the above technical problems, another technical solution that the present invention uses is: a kind of webpage transcoding device is provided,
Described device includes: sending module, for needing user to click to execute JavaScript's in the page when the first time transcoding after
Element is clicked, then sends the web-page requests including webpage information to server, wherein the webpage information includes the element
The uniform resource locator of the original web page of position, the page in the original web page of the page;Receiving module is used for
Receive the page after the server responds the web-page requests and second of transcoding returning, wherein second of transcoding
The page afterwards is the original web page that the server loads the page according to the uniform resource locator, and according to described
Position positions the element in the original web page, and generation obtains the click event of the element to execute JavaScript
Corresponding webpage, and the corresponding webpage is carried out what transcoding obtained;Display module, after showing second of transcoding
The page.
The beneficial effects of the present invention are: being in contrast to the prior art, the present invention is in page after first time transcoding
It needs user to click to execute the element of JavaScript and be clicked, then sends the web-page requests including webpage information to server,
Wherein, webpage information include position of the element in the original web page of the page, the page original web page uniform resource locator;
The web-page requests of server reception browser;According to the original web page of uniform resource locator loading page, and according to position
The location element in original web page, and generate the click event to element and obtain corresponding webpage to execute JavaScript, it will be right
Webpage is answered to carry out second of transcoding;The page after second of transcoding is sent to browser;It receives server and responds web-page requests
And the page after second of the transcoding returned;The page after showing second of transcoding.In this way, can guarantee to need to use
It clicks to execute the webpage function of the element of JavaScript in the normal use of client at family.
Detailed description of the invention
Fig. 1 is the flow chart of one embodiment of webpage code-transferring method of the present invention;
Fig. 2 is the flow chart of another embodiment of webpage code-transferring method of the present invention;
Fig. 3 is the display effect signal of a specific webpage on a personal computer in webpage code-transferring method of the present invention
Figure;
Fig. 4 is the display effect in webpage code-transferring method of the present invention after a specific webpage first time transcoding on mobile phone
Schematic diagram;
Fig. 5 is the display effect in webpage code-transferring method of the present invention after second of transcoding of a specific webpage on mobile phone
Schematic diagram;
Fig. 6 is the structural schematic diagram of one embodiment of server of the present invention;
Fig. 7 is the structural schematic diagram of one embodiment of webpage transcoding device of the present invention.
Specific embodiment
The present invention is described in detail with embodiment with reference to the accompanying drawing.
Refering to fig. 1, Fig. 1 is the flow chart of one embodiment of webpage code-transferring method of the present invention, and present embodiment is server
The flow chart at end, this method comprises:
Step S101: receive browser needs user to click to execute JavaScript's in the page after first time transcoding
When element is clicked, the web-page requests including webpage information of transmission, wherein webpage information includes original net of the element in the page
The uniform resource locator of the original web page of position, the page in page.
Original web page refers to the webpage shown on a personal computer, and the interface of existing webpage and style are for individual calculus
Machine design, these original web pages are directly shown on the mobile terminal of client, display effect is bad, will by server
It after original web page transcoding, shows on mobile terminals, preferable display effect can be obtained.But due to original web page transcoding
Html code and structure vary widely afterwards, and the transcoding page does not support original web page is some user's click is needed just to be triggered
JavaScript, this causes the missing of webpage function.
In order to guarantee that user is needed to click browser exists to execute the webpage function normal use of the element of JavaScript
When the element is clicked in the page after first time transcoding, the web-page requests including webpage information are sent to server, wherein net
Page information include position of the element in the original web page of the page, the page original web page uniform resource locator.
Wherein, which includes but is not limited to: element with onclick attribute or have href attribute and with
The element of " javascript: " beginning.
Wherein, webpage information is server during carrying out first time transcoding to original web page, monitors to need to use
It is generated when the element that family is clicked to execute JavaScript.I.e. when server is when carrying out first time transcoding to original web page
It waits, if monitoring to need user to click to execute the element of JavaScript, generates webpage information, which includes
Position of the element in the original web page of the page, the page original web page uniform resource locator.When server will be for the first time
When the page after transcoding is sent to browser, the webpage information is also carried.
Step S102: according to the original web page of uniform resource locator loading page, and according to position in original web page
Middle location element, and generate the click event to element and obtain corresponding webpage to execute JavaScript, corresponding webpage is carried out
Second of transcoding.
Server receives the web-page requests of browser, includes webpage information in web-page requests, and webpage information includes member
Position of the element in the original web page of the page, the page original web page uniform resource locator.
Uniform resource locator (Uniform Resource Locator, be abbreviated as URL) is to can be from internet
The succinct expression of one kind of the position of obtained resource and access method, is the address of standard resource on internet, on internet
Each file have a unique URL, the information that it includes points out how the position of file and browser should be handled
It.
Server is fixed in original web page according to the original web page of uniform resource locator loading page, and according to position
Bit element, and generate the click event to element and obtain corresponding webpage to execute JavaScript, corresponding webpage is carried out second
Secondary transcoding.In practical applications, it specifically includes following process: (1) according to uniform resource locator, reloading original web page;
(2) according to position in original web page location element, to DOM node corresponding to element send clicking operation.Document object mould
Type (Document Object Model, be abbreviated as DOM) is that the standard of the processing extensible markup language of W3C Organisation recommendations is compiled
Journey interface, it is a kind of application programming interfaces unrelated with platform and language (API), can dynamically access program and script,
Update the style of its content, structure and www document;DOM is divided to for two kinds of HTML DOM and XML DOM;They respectively define visit
The standard method of HTML/XML document is asked and operated, and corresponding document is rendered as the tree knot with element, attribute and text
Structure (node tree).(3) JavaScript for executing element, the page after forming second of transcoding.If Html standard regulation to
Node sends click event, can trigger the JavaScript code of onclick or href attribute definition, execute the JavaScript
Code, to form the Webpage after second of transcoding.
Wherein, position of the element in original web page is with XPath language tag.
XPath is one in extensible markup language (Extensible Markup Language, be abbreviated as XML) document
The middle markup language for searching information, for being navigated in XML document by element and attribute.Certainly, element is in original net
Position in page can also be to be marked with others markup languages, such as: standard general markup language, hypertext markup
Language, extensible Hypertext Markup Language HTML etc..
Step S103: the page after second of transcoding is sent to browser, after showing second of transcoding so as to browser
The page.
Embodiment of the present invention server receives browser needs user to click to execute in the page after first time transcoding
When the element of JavaScript is clicked, the web-page requests including webpage information of transmission, webpage information includes element in the page
Original web page in position, the page original web page uniform resource locator;According to uniform resource locator loading page
Original web page, and according to position in original web page location element, and generate to the click event of element to execute
JavaScript obtains corresponding webpage, and corresponding webpage is carried out second of transcoding;The page after second of transcoding is sent to clear
Look at device, the page after second of transcoding is shown so as to browser.In this way, can guarantee that user is needed to click to execute
Normal use of the webpage function of the element of JavaScript in client.
Referring to Fig.2, Fig. 2 is the flow chart of another embodiment of webpage code-transferring method of the present invention, present embodiment is client
The flow chart at end, this method comprises:
Step S201: user is needed to click in page after first time transcoding to execute the element of JavaScript by point
It hits, then sends the web-page requests including webpage information to server, wherein webpage information includes original web page of the element in the page
In position, the page original web page uniform resource locator.
Original web page refers to the webpage shown on a personal computer, and the interface of existing webpage and style are for individual calculus
Machine design, these original web pages are directly shown on the mobile terminal of client, display effect is bad, will by server
It after original web page transcoding, shows on mobile terminals, preferable display effect can be obtained.But due to original web page transcoding
Html code and structure vary widely afterwards, and the transcoding page does not support original web page is some user's click is needed just to be triggered
JavaScript, this causes the missing of webpage function.
In order to guarantee that user is needed to click to execute the webpage function normal use of the element of JavaScript, for the first time
When the element is clicked in the page after transcoding, browser sends the web-page requests including webpage information to server, wherein net
Page information include position of the element in the original web page of the page, the page original web page uniform resource locator.
Wherein, which includes but is not limited to: element with onclick attribute or have href attribute and with
The element of " javascript: " beginning.
Wherein, webpage information is server during carrying out first time transcoding to original web page, monitors to need to use
It is generated when the element that family is clicked to execute JavaScript.I.e. when server is when carrying out first time transcoding to original web page
It waits, if monitoring to need user to click to execute the element of JavaScript, generates webpage information, which includes
Position of the element in the original web page of the page, the page original web page uniform resource locator.When server will be for the first time
When the page after transcoding is sent to browser, the webpage information is also carried.When element is clicked, can firstly generate including net
The web-page requests of page information.
Step S202: the page after receiving second of transcoding that server is returned in response to web-page requests, wherein second
The page after transcoding is original web page of the server according to uniform resource locator loading page, and according to position in original net
Location element in page generates the click event to element to execute JavaScript and obtain corresponding webpage, and will corresponding webpage
Carry out what transcoding obtained.
Uniform resource locator (Uniform Resource Locator, be abbreviated as URL) is to can be from internet
The succinct expression of one kind of the position of obtained resource and access method, is the address of standard resource on internet, on internet
Each file have a unique URL, the information that it includes points out how the position of file and browser should be handled
It.
After server receives the web-page requests of browser transmission, due to including webpage information, webpage in web-page requests
Information include position of the element in the original web page of the page, the page original web page uniform resource locator, server root
According to the original web page of uniform resource locator loading page, and according to position in original web page location element, and generate pair
The click event of element obtains corresponding webpage to execute JavaScript, and corresponding webpage is carried out second of transcoding.Then, it services
The page after second of transcoding is returned to browser by device, and therefore, browser receives server and returns in response to web-page requests
The page after second of transcoding.
Wherein, position of the element in original web page is with XPath language tag.
XPath is one in extensible markup language (Extensible Markup Language, be abbreviated as XML) document
The middle markup language for searching information, for being navigated in XML document by element and attribute.Certainly, element is in original net
Position in page can also be to be marked with others markup languages, such as: standard general markup language, hypertext markup
Language, extensible Hypertext Markup Language HTML etc..
Step S203: the page after second of transcoding of display.
Embodiment of the present invention needs user to click to execute the element of JavaScript in page after first time transcoding
It is clicked, then browser sends the web-page requests including webpage information to server, wherein webpage information includes element in the page
Original web page in position, the page original web page uniform resource locator;Server is received to return in response to web-page requests
The page after second of the transcoding returned, wherein the page after second of transcoding is that server is loaded according to uniform resource locator
The original web page of the page, and according to position in original web page location element, generate to the click event of element to execute
JavaScript obtains corresponding webpage, and corresponding webpage is carried out what transcoding obtained;The page after showing second of transcoding.It is logical
This mode is crossed, can guarantee that user is needed to click to execute the webpage function of the element of JavaScript in the normal of client
It uses.
Illustrate the implementation result of the method for the present invention with a specific example below.
Such as webpage:http://tool.xdf.cn/xhy/result_xinzitoushangyibadao.html, the net
Page display effect on a personal computer as shown in figure 3, first time transcoding be suitble to mobile phone (client) to show effect such as
Shown in Fig. 4, when checking answer when the user clicks, server receives the web-page requests from mobile phone browser:
Http: // 10.1.45.123:16747/?Src=http%3A%2F%2Ftool.xdf.cn%2Fxhy% 2Fresult_xinzitoushangyibadao.html&Clicks=%2F%2Fa%5B%40class%3Danswer% 5D
In the web-page requests, bolded section is server and port;Underscore part be original web page address (i.e.
http://tool.xdf.cn/xhy/result_xinzitoushangyibadao.html);Runic and underscore part are to need
The position Xpath (i.e. //a [@class='answer']) for the element for wanting user to click.
According to above-mentioned web-page requests, server reappears load original web page, then needs user to click according to Xpath positioning
Element, be sent to it click event, triggering JavaScript is executed, then second of transcoding output.Browser is shown again
Webpage after second of transcoding, display result are as shown in Figure 5.
In the prior art, after by existing transcoding technology transcoding, the page shown in Fig. 4 can be obtained, still, works as user
When clicking " checking answer ", it cannot show answer, i.e., cannot obtain the page shown in fig. 5.Such as: pass through the page of Baidu's transcoding
Face:
Http:// gate.baidu.com/tc? bd_page_type=1&src=http%3A%2F% 2Ftool.xdf.cn%2Fxhy%2Fresult_xinzitoushangyibadao.html, and do not show answer.
Webpage code-transferring method provided by the invention reloads the page in server, executes click by request server
Event, and after transcoding output, browser can correctly show answer.
It is the structural schematic diagram of one embodiment of server of the present invention refering to Fig. 6, Fig. 6, which includes: receiving module
101, execution module 102 and sending module 103.
Receiving module 101 needs user to click to execute for receiving browser in the page after first time transcoding
When the element of JavaScript is clicked, the web-page requests including webpage information of transmission, wherein webpage information includes that element exists
The uniform resource locator of the original web page of position, the page in the original web page of the page.
Original web page refers to the webpage shown on a personal computer, and the interface of existing webpage and style are for individual calculus
Machine design, these original web pages are directly shown on the mobile terminal of client, display effect is difficult to see, passes through server
It after original web page transcoding, shows on mobile terminals, preferable display effect can be obtained.But since original web page turns
Html code and structure vary widely after code, and the transcoding page does not support original web page is some user's click is needed just to be triggered
JavaScript, this causes the missing of webpage function.
In order to guarantee that user is needed to click browser exists to execute the webpage function normal use of the element of JavaScript
When the element is clicked in the page after first time transcoding, the web-page requests including webpage information are sent to server, wherein net
Page information include position of the element in the original web page of the page, the page original web page uniform resource locator.
Wherein, which includes but is not limited to: element with onclick attribute or have href attribute and with
The element of " javascript: " beginning.
Wherein, webpage information is server during carrying out first time transcoding to original web page, monitors to need to use
It is generated when the element that family is clicked to execute JavaScript.I.e. when server is when carrying out first time transcoding to original web page
It waits, if monitoring to need user to click to execute the element of JavaScript, generates webpage information, which includes
Position of the element in the original web page of the page, the page original web page uniform resource locator.When server will be for the first time
When the page after transcoding is sent to browser, the webpage information is also carried.
Execution module 102 is used for the original web page according to uniform resource locator loading page, and according to position in original
Location element in beginning webpage, and generate the click event to element and obtain corresponding webpage to execute JavaScript, by corresponding net
Page carries out second of transcoding.
Server receives the web-page requests of browser, includes webpage information in web-page requests, and webpage information includes member
Position of the element in the original web page of the page, the page original web page uniform resource locator.
Uniform resource locator (Uniform Resource Locator, be abbreviated as URL) is to can be from internet
The succinct expression of one kind of the position of obtained resource and access method, is the address of standard resource on internet, on internet
Each file have a unique URL, the information that it includes points out how the position of file and browser should be handled
It.
According to the original web page of uniform resource locator loading page, and member is positioned in original web page according to position
Element, and generate the click event to element and obtain corresponding webpage to execute JavaScript, corresponding webpage is carried out second turn
Code.
Wherein, position of the element in original web page is with XPath language tag.
XPath is one in extensible markup language (Extensible Markup Language, be abbreviated as XML) document
The middle markup language for searching information, for being navigated in XML document by element and attribute.Certainly, element is in original net
Position in page can also be to be marked with others markup languages, such as: standard general markup language, hypertext markup
Language, extensible Hypertext Markup Language HTML etc..
Sending module 103 is used to the page after second of transcoding being sent to browser, so that browser is shown second
The page after transcoding.
Embodiment of the present invention server receives browser needs user to click to execute in the page after first time transcoding
When the element of JavaScript is clicked, the web-page requests including webpage information of transmission, webpage information includes element in the page
Original web page in position, the page original web page uniform resource locator;According to uniform resource locator loading page
Original web page, and according to position in original web page location element, and generate to the click event of element to execute
JavaScript obtains corresponding webpage, and corresponding webpage is carried out second of transcoding;The page after second of transcoding is sent to clear
Look at device, the page after second of transcoding is shown so as to browser.In this way, can guarantee that user is needed to click to execute
Normal use of the webpage function of the element of JavaScript in client.
It is the structural schematic diagram of one embodiment of webpage transcoding device of the present invention refering to Fig. 7, Fig. 7, which includes: to send
Module 201, receiving module 202 and display module 203.
Sending module 201 is for needing user to click in page after first time transcoding to execute the element of JavaScript
It is clicked, then sends the web-page requests including webpage information to server, wherein webpage information includes element in the original of the page
The uniform resource locator of the original web page of position, the page in webpage.
Original web page refers to the webpage shown on a personal computer, and the interface of existing webpage and style are for individual calculus
Machine design, these original web pages are directly shown on the mobile terminal of client, display effect is bad, will by server
It after original web page transcoding, shows on mobile terminals, preferable display effect can be obtained.But due to original web page transcoding
Html code and structure vary widely afterwards, and the transcoding page does not support original web page is some user's click is needed just to be triggered
JavaScript, this causes the missing of webpage function.
In order to guarantee that user is needed to click to execute the webpage function normal use of the element of JavaScript, for the first time
When the element is clicked in the page after transcoding, browser sends the web-page requests including webpage information to server, wherein net
Page information include position of the element in the original web page of the page, the page original web page uniform resource locator.
Wherein, which includes but is not limited to: element with onclick attribute or have href attribute and with
The element of " javascript: " beginning.
Wherein, webpage information is server during carrying out first time transcoding to original web page, monitors to need to use
It is generated when the element that family is clicked to execute JavaScript.I.e. when server is when carrying out first time transcoding to original web page
It waits, if monitoring to need user to click to execute the element of JavaScript, generates webpage information, which includes
Position of the element in the original web page of the page, the page original web page uniform resource locator.When server will be for the first time
When the page after transcoding is sent to browser, the webpage information is also carried.
Receiving module 202 is for receiving the page after second of transcoding that server is returned in response to web-page requests, wherein
The page after second of transcoding is original web page of the server according to uniform resource locator loading page, and is existed according to position
Location element in original web page generates the click event to element to execute JavaScript and obtain corresponding webpage, and will be right
Webpage is answered to carry out what transcoding obtained.
Uniform resource locator (Uniform Resource Locator, be abbreviated as URL) is to can be from internet
The succinct expression of one kind of the position of obtained resource and access method, is the address of standard resource on internet, on internet
Each file have a unique URL, the information that it includes points out how the position of file and browser should be handled
It.
After server receives the web-page requests of browser transmission, due to including webpage information, webpage in web-page requests
Information include position of the element in the original web page of the page, the page original web page uniform resource locator, server root
According to the original web page of uniform resource locator loading page, and according to position in original web page location element, and generate pair
The click event of element obtains corresponding webpage to execute JavaScript, and corresponding webpage is carried out second of transcoding.Then, it services
The page after second of transcoding is returned to browser by device, and therefore, browser receives server and returns in response to web-page requests
The page after second of transcoding.
Wherein, position of the element in original web page is with XPath language tag.
XPath is one in extensible markup language (Extensible Markup Language, be abbreviated as XML) document
The middle markup language for searching information, for being navigated in XML document by element and attribute.Certainly, element is in original net
Position in page can also be to be marked with others markup languages, such as: standard general markup language, hypertext markup
Language, extensible Hypertext Markup Language HTML etc..
Display module 203 is for showing the page after second of transcoding.
Embodiment of the present invention needs user to click to execute the element of JavaScript in page after first time transcoding
It is clicked, then browser sends the web-page requests including webpage information to server, wherein webpage information includes element in the page
Original web page in position, the page original web page uniform resource locator;Server is received to return in response to web-page requests
The page after second of the transcoding returned, wherein the page after second of transcoding is that server is loaded according to uniform resource locator
The original web page of the page, and according to position in original web page location element, generate to the click event of element to execute
JavaScript obtains corresponding webpage, and corresponding webpage is carried out what transcoding obtained;The page after showing second of transcoding.It is logical
This mode is crossed, can guarantee that user is needed to click to execute the webpage function of the element of JavaScript in the normal of client
It uses.
Mode the above is only the implementation of the present invention is not intended to limit the scope of the invention, all to utilize this
Equivalent structure or equivalent flow shift made by description of the invention and accompanying drawing content, it is relevant to be applied directly or indirectly in other
Technical field is included within the scope of the present invention.
Claims (10)
1. a kind of webpage code-transferring method, which is characterized in that the described method includes:
When receive browser needs user to click to be clicked to execute the element of JavaScript in the page after first time transcoding,
The web-page requests including webpage information sent, wherein the webpage information includes original net of the element in the page
The uniform resource locator of the original web page of position, the page in page;
The original web page of the page is loaded according to the uniform resource locator, and according to the position in the original net
The element is positioned in page, and generates the click event to the element and obtains corresponding webpage to execute JavaScript, by institute
It states corresponding webpage and carries out second of transcoding;
The page after second of transcoding is sent to the browser, after showing second of transcoding so as to the browser
The page.
2. the method according to claim 1, wherein the webpage information is that server is carried out to original web page
During first time transcoding, monitor user is needed to click to execute and generate when the element of JavaScript.
3. the method according to claim 1, wherein position of the element in the original web page with
XPath language tag.
4. the method according to claim 1, wherein the element include have onclick attribute element or
The element started with href attribute and with " javascript: ".
5. a kind of webpage code-transferring method, which is characterized in that the described method includes:
It needs user to click in page after first time transcoding to execute the element of JavaScript and be clicked, is then sent out to server
Send the web-page requests including webpage information, wherein the webpage information includes the element in the original web page of the page
Position, the page original web page uniform resource locator;
Receive the page after the server responds the web-page requests and second of transcoding returning, wherein described second
The page after transcoding is the original web page that the server loads the page according to the uniform resource locator, and according to
The position positions the element in the original web page, generates to the click event of the element to execute JavaScript
Corresponding webpage is obtained, and the corresponding webpage is carried out what transcoding obtained;
The page after showing second of transcoding.
6. a kind of server, which is characterized in that the server includes:
Receiving module needs user to click in the page after first time transcoding for receiving browser to execute JavaScript's
When element is clicked, the web-page requests including webpage information of transmission, wherein the webpage information includes the element described
The uniform resource locator of the original web page of position, the page in the original web page of the page;
Execution module, for loading the original web page of the page according to the uniform resource locator, and according to institute's rheme
It sets and positions the element in the original web page, and generate and the click event of the element is obtained with executing JavaScript
The corresponding webpage is carried out second of transcoding by corresponding webpage;
Sending module, for the page after second of transcoding to be sent to the browser, show so as to the browser described in
The page after second of transcoding.
7. server according to claim 6, which is characterized in that the webpage information be server to original web page into
During row first time transcoding, monitor user is needed to click to execute and generate when the element of JavaScript.
8. server according to claim 6, which is characterized in that position of the element in the original web page with
XPath language tag.
9. server according to claim 6, which is characterized in that the element include the element with onclick attribute,
Or the element started with href attribute and with " javascript: ".
10. a kind of webpage transcoding device, which is characterized in that described device includes:
Sending module, for needing user to click to execute the element of JavaScript by point in the page when the first time transcoding after
It hits, then sends the web-page requests including webpage information to server, wherein the webpage information includes the element in the page
The uniform resource locator of the original web page of position, the page in the original web page in face;
Receiving module, for receiving the page after the server responds the web-page requests and second of transcoding returning,
In, the page after second of transcoding is that the server according to the uniform resource locator loads the original of the page
Webpage, and the element is positioned in the original web page according to the position, generate to the click event of the element with
It executes JavaScript and obtains corresponding webpage, and the corresponding webpage is carried out what transcoding obtained;
Display module, for showing the page after second of transcoding.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410522095.3A CN105528369B (en) | 2014-09-30 | 2014-09-30 | Webpage code-transferring method, device and server |
PCT/CN2015/087795 WO2016050124A1 (en) | 2014-09-30 | 2015-08-21 | Method, device and server for web page transcoding |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410522095.3A CN105528369B (en) | 2014-09-30 | 2014-09-30 | Webpage code-transferring method, device and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105528369A CN105528369A (en) | 2016-04-27 |
CN105528369B true CN105528369B (en) | 2019-03-15 |
Family
ID=55629415
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410522095.3A Active CN105528369B (en) | 2014-09-30 | 2014-09-30 | Webpage code-transferring method, device and server |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105528369B (en) |
WO (1) | WO2016050124A1 (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107844501A (en) * | 2016-09-20 | 2018-03-27 | 天脉聚源(北京)科技有限公司 | A kind of method and system of mobile terminal processing web page popup window |
CN108829398B (en) * | 2018-03-27 | 2022-06-17 | 厦门欣旅通科技有限公司 | Mobile terminal page interaction realization method and device |
CN109559174B (en) * | 2018-11-30 | 2021-04-16 | 上海连尚网络科技有限公司 | Method for dotting popularization resource and counting click of popularization resource |
CN112583602B (en) * | 2020-12-08 | 2022-10-28 | 数字广东网络建设有限公司 | Information code data transmission method, device, system, computer device and medium |
CN112364271A (en) * | 2020-12-15 | 2021-02-12 | 北京商越网络科技有限公司 | Method for acquiring access transfer information between webpages |
CN114327207A (en) * | 2021-11-22 | 2022-04-12 | 北京云测信息技术有限公司 | Element positioning method and device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102902802A (en) * | 2012-10-12 | 2013-01-30 | 北京奇虎科技有限公司 | Webpage transcoding method and device |
CN103166981A (en) * | 2011-12-08 | 2013-06-19 | 腾讯科技(深圳)有限公司 | Wireless webpage transcoding method and device |
CN103226475A (en) * | 2013-05-16 | 2013-07-31 | 百度在线网络技术(北京)有限公司 | Method and device for realizing control replacement during transcoding |
CN103577451A (en) * | 2012-07-30 | 2014-02-12 | 百度在线网络技术(北京)有限公司 | Webpage transcoding method, webpage transcoding device and webpage transcoding system |
CN103631795A (en) * | 2012-08-22 | 2014-03-12 | 百度在线网络技术(北京)有限公司 | Method and device for converting webpages in network equipment and equipment |
-
2014
- 2014-09-30 CN CN201410522095.3A patent/CN105528369B/en active Active
-
2015
- 2015-08-21 WO PCT/CN2015/087795 patent/WO2016050124A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103166981A (en) * | 2011-12-08 | 2013-06-19 | 腾讯科技(深圳)有限公司 | Wireless webpage transcoding method and device |
CN103577451A (en) * | 2012-07-30 | 2014-02-12 | 百度在线网络技术(北京)有限公司 | Webpage transcoding method, webpage transcoding device and webpage transcoding system |
CN103631795A (en) * | 2012-08-22 | 2014-03-12 | 百度在线网络技术(北京)有限公司 | Method and device for converting webpages in network equipment and equipment |
CN102902802A (en) * | 2012-10-12 | 2013-01-30 | 北京奇虎科技有限公司 | Webpage transcoding method and device |
CN103226475A (en) * | 2013-05-16 | 2013-07-31 | 百度在线网络技术(北京)有限公司 | Method and device for realizing control replacement during transcoding |
Also Published As
Publication number | Publication date |
---|---|
WO2016050124A1 (en) | 2016-04-07 |
CN105528369A (en) | 2016-04-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105528369B (en) | Webpage code-transferring method, device and server | |
JP5695027B2 (en) | Method and system for acquiring AJAX web page content | |
US8849985B1 (en) | On-the-fly instrumentation of Web applications, Web-pages or Web-sites | |
US8639743B1 (en) | System and method for on-the-fly rewriting of JavaScript | |
EP2724251B1 (en) | Methods for making ajax web applications bookmarkable and crawlable and devices thereof | |
CN103412890A (en) | Webpage loading method and device | |
US8387008B2 (en) | Method for sharing a function between web contents | |
US20140201617A1 (en) | Method for Browsing Web Page on Mobile Terminal | |
CN105095280A (en) | Caching method and apparatus for browser | |
US8082488B2 (en) | Method for accessing a parent page while browsing web pages | |
US8065617B2 (en) | Discovering alternative user experiences for websites | |
TWI592807B (en) | Method and device for web style address merge | |
US8819539B1 (en) | On-the-fly rewriting of uniform resource locators in a web-page | |
CN101876897A (en) | System and method used for processing Widget on Web browser | |
US20090288099A1 (en) | Apparatus and method for accessing and indexing dynamic web pages | |
US9081866B2 (en) | Dynamic display of web page content based on a rules system | |
US20120158961A1 (en) | System for enabling rich network applications | |
EP2648388B1 (en) | Method, system, and device for displaying page | |
CN103577427A (en) | Browser kernel based web page crawling method and device and browser containing device | |
CN106897336A (en) | Web page files sending method, webpage rendering intent and device, webpage rendering system | |
US9122484B2 (en) | Method and apparatus for mashing up web applications | |
KR20120122959A (en) | Method and Device for Collecting Web Contents and Computer-readable Recording Medium for the same | |
US10095791B2 (en) | Information search method and apparatus | |
Oh et al. | Automated transformation of template-based web applications into single-page applications | |
Xiaoshu | Optimized development of web front-end development technology |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210108 Address after: 310052 room 508, 5th floor, building 4, No. 699 Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province Patentee after: Alibaba (China) Co.,Ltd. Address before: 100080 12 / F, 28 Chengfu Road, Haidian District, Beijing Patentee before: UC MOBILE Ltd. |