Method and device for cross-domain transfer of data
A data and cross-domain technology, which is applied in the field of data acquisition between web pages, can solve problems such as weak security, inability to meet the cross-domain transmission requirements of clients that cannot install flash plug-ins, and additional plug-in installations in browsers to ensure security Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0032] Such as figure 1 As shown, a method for cross-domain data transfer provided by an embodiment of the present invention includes:
[0033] 101. Load the second page in the form of a subpage iframe tag on the first page, and store the data of the second page into the name attribute window.name of the subpage.
[0034] Wherein, the loading of the second page in the form of a subpage iframe tag in the first page is specifically: creating an iframe in the first page, the src attribute value of the iframe is the address of the second page, and passing through the iframe The second page is loaded.
[0035] It is worth noting that, during the process of loading the second page, the second page contains a script, wherein the following action exists in the script: an action of storing the data of the second page in the window.name of the iframe.
[0036] 102. After the loading is complete, the sub-page jumps to a proxy page, and the proxy page has the same origin as the first pa...
Embodiment 2
[0045] In order to enable those skilled in the art to better understand the method for data cross-domain transfer provided by the embodiment of the present invention, the method is now described in detail.
[0046] The characteristics of window.name make it very suitable for cross-domain transmission of large data. First, under the current tab, no matter how the URL of the page or subpage changes, window.name will exist and be stored in the browser without increasing HTTP number of requests. Second, in browsers that currently support JavaScript, window.name can store at least 2 megabytes of data (Mozilla Firefox, IE9, Google Chrome can store 32 megabytes or more). Plus, it doesn't require users to install any additional plug-ins on their browsers.
[0047] The basic principle of window.name cross-domain transfer data is that when the subpage iframe in the page loads the page, the value of window.name will persist. Therefore, when the iframe is redirected from the foreign doma...
Embodiment 3
[0063] Such as Figure 4 As shown, a device for cross-domain data transfer provided by an embodiment of the present invention includes:
[0064] The execution unit 41 is used to load the second page in the form of a subpage iframe tag in the first page, and store the data of the second page into the name attribute window.name of the subpage;
[0065] In this example, if Figure 5 As shown, the execution unit includes:
[0066] Creating a subunit 411 for creating a subpage iframe in the first page, the source src attribute value of the subpage is the address of the second page;
[0067] The loading subunit 412 is configured to load a second page through the subpage, and store the data of the second page into window.name of the subpage according to the script in the second page.
[0068] A jumping unit 42, configured to jump the subpage to a proxy page after the execution unit is loaded, and the proxy page has the same source as the first page;
[0069] The obtaining unit 43...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 