CN104317819A - Method and system for webpage cross-domain communication based on browsers - Google Patents

Method and system for webpage cross-domain communication based on browsers Download PDF

Info

Publication number
CN104317819A
CN104317819A CN201410508440.8A CN201410508440A CN104317819A CN 104317819 A CN104317819 A CN 104317819A CN 201410508440 A CN201410508440 A CN 201410508440A CN 104317819 A CN104317819 A CN 104317819A
Authority
CN
China
Prior art keywords
message
page
markup language
hypertext markup
html
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.)
Pending
Application number
CN201410508440.8A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201410508440.8A priority Critical patent/CN104317819A/en
Publication of CN104317819A publication Critical patent/CN104317819A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a method and a system for webpage cross-domain communication based on browsers. The method comprises the following steps of determining whether a browser of a first domain name webpage supports a message sending interface of a hypertext markup language 5 or not; when the browser of the first domain name webpage supports the message sending interface of the hypertext markup language 5, using the message sending interface of the hypertext markup language 5 to send a message; when the browser of the first domain name webpage does not support the message sending interface of the hypertext markup language 5, sending the message in the way of using the name of a target object in the first domain name webpage; determining whether a browser of a second domain name webpage supports a message receiving interface of the hypertext markup language 5 or not; when the browser of the second domain name webpage is determined to support the message receiving interface of the hypertext markup language 5, using a message event of the hypertext markup language 5 to complete the webpage cross-domain communication in the second domain name webpage; when the browser of the second domain name webpage is determined not to support the message receiving interface of the hypertext markup language, obtaining the name value to complete the webpage cross-domain communication in the second domain name webpage.

Description

Based on the method and system of cross-domain communication between browser page
Technical field
The present invention relates to a kind of method and system based on cross-domain communication between browser page.
Background technology
In all web cloudlike worktable apply, the page of other third-party application introduced by frequent needs in the page of this application, and the page of web application needs to intercom mutually with the third-party application page, the such as third-party application page needs to obtain the user name etc. that the page of web application shows.In this case, the javascript script in the page of web application needs certain function of the javascript script called on third party's page, and due to the safe limit of browser, between the cross-domain name page mutually directly communication be unallowed.Between the current page, cross-domain mutual communication has following several mode:
First kind of way: utilize the name attribute of the window object of the page script of two different domain names to access mutually and communicate.This mode only supports IE6, IE7, IE8, IE9 browser, but does not support IE10, firefox and chrome browser, therefore can not accomplish to support various browser.
The second way: the local communication application programming interfaces utilizing HTML (Hypertext Markup Language) 5 (html5), html5 provides postMessage script interface and message event.PostMessage script interface can send out message, and message event can monitor the message that this page receives.The current chrome of only having, firefox and more than IE10 just support this mode, and other browser does not support this mode, therefore can not accomplish various browser support.
The third mode: utilize the mode that can directly communicate between two pages under same domain name.Be specially: in the page A of the first domain name, by iframe label, point to the address of the second domain name page B, introduce the content of the second domain name page B.First domain name page A sends out message and creates an iframe label to the script of the second domain name page B: the first domain name page A, and the address of the second domain name page C is pointed in page address, using message as character string, splice with the form of parameter and page address, second name server is according to the parameter of request, the script of dynamic generation page C, return to browser, browser is when performing page C, the script of this page C can be performed, this script can the script of direct invoking page B, and import this parameter into (because the same source policy of browser, can directly communicate between the page under same domain name), the script function of the second domain name page B accepts this parameter, then corresponding process is done.Second domain name page B sends out message and creates an iframe label to the script of the first domain name page A: the second domain name page B, and the address of the first domain name page D is pointed in page address, using message as character string, splice with the form of parameter and page address, first name server dynamically generates the script of page D according to the parameter of request, return to browser, browser is when performing page D, the script of this page D can be performed, this script can the script of direct invoking page A, and import this parameter into (because the same source policy of browser, can directly communicate between the page under same domain name), the script function of the first domain name page A accepts this parameter, then corresponding process is done.Current cloud worktable have employed this third mode.
Although this kind of all browser of mode is all supported, the cross-domain communication between each page, all needs to ask corresponding server, the network service of increase and service end, and browser also needs extra loading and a parsing page, increases browser internal memory.
Owing to adopting the third mode at present, if call very frequent between the first domain name page and the second domain name page, then can produce network request many times, increase the number of network connections of service end and client, browser also can separate the iframe document that factorial produces at every turn alternately, increases browser internal memory.
If adopt first and second kinds of modes, can cause again and only support part browser, cause Consumer's Experience extreme difference.
Therefore, expect to provide a kind of method and system based on cross-domain communication between browser page.
Summary of the invention
In order to solve in above-mentioned shortcoming of the prior art and problem at least one and the present invention is proposed.Based on the shortcoming that prior art exists, the invention provides a kind of method and system based on cross-domain communication between browser page of improvement.According to method and system of the present invention, can be implemented in mutual frequently calling between the cross-domain page in various browser, and do not need to carry out network service with service end, do not need to load the extra page, namely can intercom mutually between the page.
According to an aspect, the present invention proposes a kind of method based on cross-domain communication between browser page, comprising: determine whether the browser of the first domain name page supports the message transmission interface of HTML (Hypertext Markup Language) 5; When determining that the message transmission interface of HTML (Hypertext Markup Language) 5 supported by the browser of the first domain name page, in the first domain name page, use the message transmission interface of HTML (Hypertext Markup Language) 5 to send message; When determining that the message transmission interface of HTML (Hypertext Markup Language) 5 do not supported by the browser of the first domain name page, in the first domain name page, use the form of the title of destination object to send message; Determine whether the browser of the second domain name page supports the message sink interface of HTML (Hypertext Markup Language) 5; When determining that the message sink interface of HTML (Hypertext Markup Language) 5 supported by the browser of the second domain name page, in the second domain name page, use the message event of HTML (Hypertext Markup Language) to complete cross-domain communication between the page; And when determining that the message sink interface of HTML (Hypertext Markup Language) 5 do not supported by the browser of the second domain name page, in the second domain name page, complete cross-domain communication between the page by obtaining name-value.
Alternatively, determine whether browser supports the message transmission interface of HTML (Hypertext Markup Language) 5 by judging whether the message transmission interface of HTML (Hypertext Markup Language) 5 exists.
Alternatively, use the message transmission interface of HTML (Hypertext Markup Language) 5 to carry out transmission packet to draw together: arrange message object; Message object is converted to the character string of particular form; And the message of character string forms is sent to the second domain name page by the Message function of sending out of the browser calling the first domain name page.
Alternatively, described particular form is the form of key-value pair.
Alternatively, use the form of the title of destination object to carry out transmission packet to draw together: use the title of destination object to come to be the title assignment in the second domain name page.
Alternatively, determine whether browser supports the message sink interface of HTML (Hypertext Markup Language) 5 by judging whether the message transmission interface of HTML (Hypertext Markup Language) 5 exists.
Alternatively, use the message event of HTML (Hypertext Markup Language) to complete cross-domain communication between the page to comprise: use the interpolation event methods of browser to carry out binding message resolving.
Alternatively, complete cross-domain communication between the page by acquisition name-value to comprise: by obtaining the name-value of the second domain name page by predetermined space; The name-value newly obtained and previous name-value are compared; If the new name-value obtained is different with the name-value previously obtained, then perform message parsing process.
Alternatively, described resolving comprises the message message groups of received character string forms being dressed up predetermined format, obtains the property value of message, and completes cross-domain communication between the page based on obtained property value.
According to another aspect of the present invention, provide a kind of system based on cross-domain communication between browser page, comprise: message sending mode determination module, for by determining whether the browser of the first domain name page supports that the message transmission interface of HTML (Hypertext Markup Language) 5 determines message sending mode; Message transmission module, for supporting to use the message transmission interface of HTML (Hypertext Markup Language) 5 to send message when the message transmission interface of HTML (Hypertext Markup Language) 5 at the browser of the first domain name page, and do not support to use the form of the title of destination object to send message when the message transmission interface of HTML (Hypertext Markup Language) 5 at the browser of the first domain name page; Message reception mode determination module, for by determining whether the browser of the second domain name page supports that the message sink interface of HTML (Hypertext Markup Language) 5 determines message reception mode; And message reception module, use the message event of HTML (Hypertext Markup Language) to complete cross-domain communication between the page for supporting at the browser of the second domain name page during message sink interface of HTML (Hypertext Markup Language) 5, and complete cross-domain communication between the page when the message sink interface of HTML (Hypertext Markup Language) 5 do not supported by the browser of the second domain name page by obtaining name-value.
Alternatively, by judging whether the message transmission interface of HTML (Hypertext Markup Language) 5 exists, described message sending mode determination module determines whether browser supports the message transmission interface of HTML (Hypertext Markup Language) 5.
Alternatively, described message transmission module message object is arranged, message object is converted to particular form character string and call the first domain name page browser send out a Message function message of character string forms is sent to the second domain name page.
Alternatively, described particular form is the form of key-value pair.
Alternatively, described message transmission module uses the title of destination object to come to be the title assignment in the second domain name page.
Alternatively, by judging whether the message transmission interface of HTML (Hypertext Markup Language) 5 exists, described message reception mode determination module determines whether browser supports the message sink interface of HTML (Hypertext Markup Language) 5.
Alternatively, described message reception module uses the interpolation event methods of browser to carry out binding message resolving.
Alternatively, described message reception module by obtain by predetermined space the second domain name page name-value, the name-value newly obtained and previous name-value compared and perform message parsing process under the name-value newly obtained with the previous different situation of name-value obtained.
Alternatively, described resolving comprises the message message groups of received character string forms being dressed up predetermined format, obtains the property value of message, and completes cross-domain communication between the page based on obtained property value.
Accompanying drawing explanation
By the description carried out below in conjunction with accompanying drawing, the above and other aspects, features and advantages of some one exemplary embodiment of the present invention will become apparent to those skilled in the art, wherein:
Fig. 1 is the process flow diagram of the method based on cross-domain communication between browser page according to an embodiment of the invention; And
Fig. 2 is the block diagram of the system based on cross-domain communication between browser page according to an embodiment of the invention.
Embodiment
There is provided with reference to accompanying drawing the following describes help complete understanding one exemplary embodiment of the present invention.It comprises various details to help understanding, and they should be thought it is only exemplary.Therefore, those of ordinary skill in the art will be appreciated that, can make various change and amendment, and can not deviate from scope and spirit of the present invention to the embodiments described herein.Equally, for clarity and conciseness, the description to known function and structure is eliminated.
Fig. 1 is the process flow diagram of the method based on cross-domain communication between browser page according to an embodiment of the invention.
As shown in fig. 1, in step s 110, determine whether the browser of the first domain name page supports the message transmission interface of HTML (Hypertext Markup Language) 5 (html5).In one embodiment, can by judging whether the message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5) exists to determine whether browser supports the message transmission interface of HTML (Hypertext Markup Language) 5 (html5).Such as, when there is message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5), can determine that the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) supported by browser; And when there is not message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5), can determine that the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) do not supported by browser.
When determining that the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) supported by the browser of the first domain name page in step s 110, in the step s 120, in the first domain name page, use the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) to send message.
In one embodiment, can first arrange message object (message), such as can arrange each property value of message object, it can comprise message name (commandName), message body (commandBody), message transmitting time (commandTime) etc.Then, message object can be converted to the character string of particular form.Described particular form can be such as the form of key-value pair (key:value).Then, that calls the browser of the first domain name page sends out Message function (target.postMessage), the message of character string forms is sent to the second domain name page.The described second domain name page can be third party's domain name page.
When determining that the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) do not supported by the browser of the first domain name page in step s 110, in step s 130, which, in the first domain name page, use the form of the title of destination object (target.name) to send message.In one embodiment, it is title (name) assignment in the second domain name page that the title of destination object can be used.
No matter pass through which kind of mode, after the message has been sent, the second domain name page can receive the message sent from the first domain name page.
In step 140, determine whether the browser of the second domain name page supports the message sink interface of HTML (Hypertext Markup Language) 5 (html5).In one embodiment, can by judging whether the message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5) exists to determine whether browser supports the message sink interface of HTML (Hypertext Markup Language) 5 (html5).Such as, when there is message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5), can determine that the message sink interface of HTML (Hypertext Markup Language) 5 (html5) supported by browser; And when there is not message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5), can determine that the message sink interface of HTML (Hypertext Markup Language) 5 (html5) do not supported by browser.
When determining that the message sink interface of HTML (Hypertext Markup Language) 5 (html5) supported by the browser of the second domain name page in step 140, in step S150, in the second domain name page, use the message of HTML (Hypertext Markup Language) (html5) (message) event to complete cross-domain communication between the page.
According to an embodiment, the second domain name page can use the interpolation event methods (addEvent) of browser to carry out binding message resolving.Resolving such as can comprise the message message groups of received character string forms being dressed up predetermined format (being such as json form), obtains the property value of message, and completes cross-domain communication between the page based on obtained property value.
When determining that the message sink interface of HTML (Hypertext Markup Language) 5 (html5) do not supported by the browser of the second domain name page in step 140, in a step 160, in the second domain name page, cross-domain communication between the page is completed by obtaining name-value.
According to an embodiment, by obtaining title (name) value of the second domain name page by predetermined space, and the name-value newly obtained and previous name-value can be compared; If the new name-value obtained and the name-value different (instruction has new information) previously obtained, then can perform message parsing process.As discussed previously, resolving such as can comprise the message message groups of received character string forms being dressed up predetermined format (being such as json form), obtain the property value of message, and complete cross-domain communication between the page based on obtained property value.
Fig. 2 is the block diagram of the system based on cross-domain communication between browser page according to an embodiment of the invention.
As shown in Figure 2, system according to the present invention comprises message sending mode determination module 210, message transmission module 220, message reception mode determination module 230 and message reception module 240.
Message sending mode determination module 210 is for by determining whether the browser of the first domain name page supports that the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) determines message sending mode.In one embodiment, message sending mode determination module 210 can by judging whether the message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5) exists to determine whether browser supports the message transmission interface of HTML (Hypertext Markup Language) 5 (html5).Such as, when there is message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5), message sending mode determination module 210 can determine that the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) supported by browser; And when there is not message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5), message sending mode determination module 210 can determine that the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) do not supported by browser.
Message transmission module 220 for supporting to use the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) to send message when the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) at the browser of the first domain name page, and is not supported to use the form of the title of destination object (target.name) to send message when the message transmission interface of HTML (Hypertext Markup Language) 5 (html5) at the browser of the first domain name page.
In one embodiment, first message transmission module 220 can be arranged message object (message), such as can arrange each property value of message object, it can comprise message name (commandName), message body (commandBody), message transmitting time (commandTime) etc.Then, message object can be converted to the character string of particular form by message transmission module 220.Described particular form can be such as the form of key-value pair (key:value).Then, message transmission module 220 can call the browser of the first domain name page send out a Message function (target.postMessage) message of character string forms is sent to the second domain name page.The described second domain name page can be third party's domain name page.
It is title (name) assignment in the second domain name page that message transmission module 220 can use the title of destination object.
Message reception mode determination module 230 is for by determining whether the browser of the second domain name page supports that the message sink interface of HTML (Hypertext Markup Language) 5 (html5) determines message reception mode.In one embodiment, message reception mode determination module 230 can by judging whether the message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5) exists to determine whether browser supports the message sink interface of HTML (Hypertext Markup Language) 5 (html5).Such as, when there is message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5), message reception mode determination module 230 can determine that the message sink interface of HTML (Hypertext Markup Language) 5 (html5) supported by browser; And when there is not message transmission interface (window.postMessage) of HTML (Hypertext Markup Language) 5 (html5), message reception mode determination module 230 can determine that the message sink interface of HTML (Hypertext Markup Language) 5 (html5) do not supported by browser.
Message reception module 240 uses message (message) event of HTML (Hypertext Markup Language) (html5) to complete cross-domain communication between the page for supporting at the browser of the second domain name page during message sink interface of HTML (Hypertext Markup Language) 5 (html5), and completes cross-domain communication between the page when the message sink interface of HTML (Hypertext Markup Language) 5 (html5) do not supported by the browser of the second domain name page by obtaining name-value.
According to an embodiment, message reception module 240 can use the interpolation event methods (addEvent) of browser to carry out binding message resolving.Resolving such as can comprise the message message groups of received character string forms being dressed up predetermined format (being such as json form), obtains the property value of message, and completes cross-domain communication between the page based on obtained property value.
According to an embodiment, the name-value newly obtained and previous name-value by obtaining title (name) value of the second domain name page by predetermined space, and can compare by message reception module 240; If the new name-value obtained and the name-value different (instruction has new information) previously obtained, then can perform message parsing process.As discussed previously, resolving such as can comprise the message message groups of received character string forms being dressed up predetermined format (being such as json form), obtain the property value of message, and complete cross-domain communication between the page based on obtained property value.
Although this instructions comprises many particular implementation details, but should not be the restriction of the scope to the content that any invention maybe can be advocated by these detailed explanation, and should be interpreted as can specific to the description of the feature of the specific embodiment of specific invention.Some Feature Combination described in the situation of the embodiment be separated in this manual can also be realized in single embodiment.On the contrary, also each character separation described in the situation of single embodiment can be realized or realizes in any suitable sub-portfolio in multiple embodiment.In addition, work in some combination although may describe feature as above, even initial opinion so, in some cases but the one or more features from advocated combination can be left out from combination, and advocated combination can be pointed to the variant of sub-portfolio or sub-portfolio.
Similarly, although depict operation with certain order in the accompanying drawings, this should be interpreted as and need with shown certain order or perform such operation with continuous order or need to perform the result that all illustrated operations just can reach expectation.In some cases, multitask and parallel processing can be favourable.In addition, the separation of various system components in the above-described embodiments should be interpreted as and all need such separation in all embodiments, and should be understood that, usually can by described program assembly and the system integration to together with become single software product or be encapsulated as multiple software product.
Computer program (also referred to as program, software, software application, script or code) can be write by programming language in any form, described programming language comprises compiling or interpretative code, in other words illustrated or procedural language, and it can be disposed in any form, comprise as stand-alone program or other unit of using in a computing environment as module, assembly, subroutine or be suitable for.Computer program there is no need to correspond to the file in file system.Program can be stored in the file of other program of maintenance or data (such as, be stored in the one or more scripts in marking language document) a part, the Single document being exclusively used in question program or multiple coordinative file (such as, storing the file of one or more module, subroutine or partial code) in.
Above-mentioned embodiment, does not form limiting the scope of the invention.It is to be understood that depend on designing requirement and other factors, various amendment, combination, sub-portfolio can be there is and substitute in those skilled in the art.Any amendment done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within scope.

Claims (18)

1., based on a method for cross-domain communication between browser page, comprising:
Determine whether the browser of the first domain name page supports the message transmission interface of HTML (Hypertext Markup Language) 5;
When determining that the message transmission interface of HTML (Hypertext Markup Language) 5 supported by the browser of the first domain name page, in the first domain name page, use the message transmission interface of HTML (Hypertext Markup Language) 5 to send message;
When determining that the message transmission interface of HTML (Hypertext Markup Language) 5 do not supported by the browser of the first domain name page, in the first domain name page, use the form of the title of destination object to send message;
Determine whether the browser of the second domain name page supports the message sink interface of HTML (Hypertext Markup Language) 5;
When determining that the message sink interface of HTML (Hypertext Markup Language) 5 supported by the browser of the second domain name page, in the second domain name page, use the message event of HTML (Hypertext Markup Language) to complete cross-domain communication between the page; And
When determining that the message sink interface of HTML (Hypertext Markup Language) 5 do not supported by the browser of the second domain name page, in the second domain name page, complete cross-domain communication between the page by obtaining name-value.
2. by judging whether the message transmission interface of HTML (Hypertext Markup Language) 5 exists, method according to claim 1, wherein, determines whether browser supports the message transmission interface of HTML (Hypertext Markup Language) 5.
3. method according to claim 1, wherein, uses the message transmission interface of HTML (Hypertext Markup Language) 5 to carry out transmission packet and draws together:
Message object is arranged;
Message object is converted to the character string of particular form; And
The message of character string forms is sent to the second domain name page by the Message function of sending out calling the browser of the first domain name page.
4. method according to claim 3, wherein, described particular form is the form of key-value pair.
5. method according to claim 1, wherein, uses the form of the title of destination object to carry out transmission packet and draws together: use the title of destination object to come to be the title assignment in the second domain name page.
6. by judging whether the message transmission interface of HTML (Hypertext Markup Language) 5 exists, method according to claim 1, wherein, determines whether browser supports the message sink interface of HTML (Hypertext Markup Language) 5.
7. method according to claim 1, wherein, uses the message event of HTML (Hypertext Markup Language) to complete cross-domain communication between the page and comprises:
The interpolation event methods of browser is used to carry out binding message resolving.
8. method according to claim 1, wherein, completes cross-domain communication between the page by acquisition name-value and comprises:
By obtaining the name-value of the second domain name page by predetermined space;
The name-value newly obtained and previous name-value are compared;
If the new name-value obtained is different with the name-value previously obtained, then perform message parsing process.
9. the method according to claim 7 or 8, wherein, described resolving comprises the message message groups of received character string forms being dressed up predetermined format, obtains the property value of message, and completes cross-domain communication between the page based on obtained property value.
10., based on a system for cross-domain communication between browser page, comprising:
Message sending mode determination module, for by determining whether the browser of the first domain name page supports that the message transmission interface of HTML (Hypertext Markup Language) 5 determines message sending mode;
Message transmission module, for supporting to use the message transmission interface of HTML (Hypertext Markup Language) 5 to send message when the message transmission interface of HTML (Hypertext Markup Language) 5 at the browser of the first domain name page, and do not support to use the form of the title of destination object to send message when the message transmission interface of HTML (Hypertext Markup Language) 5 at the browser of the first domain name page;
Message reception mode determination module, for by determining whether the browser of the second domain name page supports that the message sink interface of HTML (Hypertext Markup Language) 5 determines message reception mode; And
Message reception module, use the message event of HTML (Hypertext Markup Language) to complete cross-domain communication between the page for supporting at the browser of the second domain name page during message sink interface of HTML (Hypertext Markup Language) 5, and complete cross-domain communication between the page when the message sink interface of HTML (Hypertext Markup Language) 5 do not supported by the browser of the second domain name page by obtaining name-value.
11. systems according to claim 10, wherein, by judging whether the message transmission interface of HTML (Hypertext Markup Language) 5 exists, described message sending mode determination module determines whether browser supports the message transmission interface of HTML (Hypertext Markup Language) 5.
12. systems according to claim 10, wherein, described message transmission module message object is arranged, message object is converted to particular form character string and call the first domain name page browser send out a Message function message of character string forms is sent to the second domain name page.
13. systems according to claim 12, wherein, described particular form is the form of key-value pair.
14. systems according to claim 10, wherein, described message transmission module uses the title of destination object to come to be the title assignment in the second domain name page.
15. systems according to claim 10, wherein, by judging whether the message transmission interface of HTML (Hypertext Markup Language) 5 exists, described message reception mode determination module determines whether browser supports the message sink interface of HTML (Hypertext Markup Language) 5.
16. systems according to claim 10, wherein, described message reception module uses the interpolation event methods of browser to carry out binding message resolving.
17. systems according to claim 10, wherein, described message reception module by obtain by predetermined space the second domain name page name-value, the name-value newly obtained and previous name-value compared and perform message parsing process under the name-value newly obtained with the previous different situation of name-value obtained.
18. systems according to claim 16 or 17, wherein, described resolving comprises the message message groups of received character string forms being dressed up predetermined format, obtains the property value of message, and completes cross-domain communication between the page based on obtained property value.
CN201410508440.8A 2014-09-28 2014-09-28 Method and system for webpage cross-domain communication based on browsers Pending CN104317819A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410508440.8A CN104317819A (en) 2014-09-28 2014-09-28 Method and system for webpage cross-domain communication based on browsers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410508440.8A CN104317819A (en) 2014-09-28 2014-09-28 Method and system for webpage cross-domain communication based on browsers

Publications (1)

Publication Number Publication Date
CN104317819A true CN104317819A (en) 2015-01-28

Family

ID=52373051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410508440.8A Pending CN104317819A (en) 2014-09-28 2014-09-28 Method and system for webpage cross-domain communication based on browsers

Country Status (1)

Country Link
CN (1) CN104317819A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886533A (en) * 2015-12-16 2017-06-23 五八同城信息技术有限公司 Mix the implementation method and device of application
CN108667863A (en) * 2017-03-29 2018-10-16 中国科学院声学研究所 A kind of WEB service adaption system and method based on local agent
CN109451058A (en) * 2018-12-21 2019-03-08 常州机电职业技术学院 A kind of cross-domain JSON method for interchanging data and system
CN110300133A (en) * 2018-03-22 2019-10-01 财付通支付科技有限公司 Cross-domain data transmission method, apparatus, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080288958A1 (en) * 2005-11-07 2008-11-20 Seung Hyup Ryoo Near Field Communication Host Controller Interface
CN102882982A (en) * 2012-10-19 2013-01-16 北京奇虎科技有限公司 Browser message sending equipment, browser message receiving equipment, communication method and communication system
CN103095762A (en) * 2011-11-02 2013-05-08 腾讯科技(深圳)有限公司 Web page cross-domain communication method and device
CN103475749A (en) * 2013-09-11 2013-12-25 北京思特奇信息技术股份有限公司 Cross-domain communication method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080288958A1 (en) * 2005-11-07 2008-11-20 Seung Hyup Ryoo Near Field Communication Host Controller Interface
US20100169686A1 (en) * 2005-11-07 2010-07-01 Seung Hyup Ryoo Near field communication host controller interface
CN103095762A (en) * 2011-11-02 2013-05-08 腾讯科技(深圳)有限公司 Web page cross-domain communication method and device
CN102882982A (en) * 2012-10-19 2013-01-16 北京奇虎科技有限公司 Browser message sending equipment, browser message receiving equipment, communication method and communication system
CN103475749A (en) * 2013-09-11 2013-12-25 北京思特奇信息技术股份有限公司 Cross-domain communication method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886533A (en) * 2015-12-16 2017-06-23 五八同城信息技术有限公司 Mix the implementation method and device of application
CN108667863A (en) * 2017-03-29 2018-10-16 中国科学院声学研究所 A kind of WEB service adaption system and method based on local agent
CN108667863B (en) * 2017-03-29 2020-04-14 中国科学院声学研究所 WEB service adaptation system and method based on local agent
CN110300133A (en) * 2018-03-22 2019-10-01 财付通支付科技有限公司 Cross-domain data transmission method, apparatus, equipment and storage medium
CN109451058A (en) * 2018-12-21 2019-03-08 常州机电职业技术学院 A kind of cross-domain JSON method for interchanging data and system

Similar Documents

Publication Publication Date Title
CN110120917B (en) Routing method and device based on content
US10630671B2 (en) Dynamic web services server
US8583810B2 (en) Session affinity cache and manager
CN102314469A (en) Method for implementing cross-domain request callback
CN112073405A (en) Webpage data loading method and device, computer equipment and storage medium
CN103246667A (en) Method and device for cross-domain transfer of data
CN105022832B (en) Method, mobile terminal and the download server that APP application securities are downloaded
CN104038510A (en) IOS system transparent agent realization method and system
CN110187932B (en) Business data page loading method and system
CN104317819A (en) Method and system for webpage cross-domain communication based on browsers
CN104572870A (en) Method, device and system supporting document online reading
CN105743945A (en) Method and system for downloading files on the basis of switching download sources
CN105554094A (en) Method and device for data interaction
CN105068802B (en) A kind of Web application software realization system and method for striding equipment operation
CN101571876A (en) Script program operation logic expansion method, server and client
CN104572099B (en) Lower coupling frame data processing method and system based on component and middleware
US9986057B2 (en) UI framework support for portal systems
CN102981846A (en) Method for treating password input box element and browser for treating the password input box element
CN104932910A (en) Method and system for application program interface extension
EP3241344A1 (en) System and method for programmatically creating resource locators
CN104143110A (en) Two-dimensional code generating method with web site information
CN106126663B (en) Page aggregation method and device
US9866614B2 (en) Methods for website version control using bucket cookies
CN105354269B (en) Web applicational language Localization methodologies and system based on reverse proxy and information filtering
CN103051722B (en) A kind ofly determine the method whether page is held as a hostage and relevant device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150128