Web page cross-domain communication method and device

A cross-domain communication and webpage technology, applied in the field of webpage processing, can solve the problem of lost cross-domain data transmission convenience, etc., to achieve the effect of reducing mutual nesting problems and reducing development costs

Inactive Publication Date: 2015-01-21
BEIJING QIHOO TECH CO LTD +1
View PDF5 Cites 27 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] At present, browsers that support JavaScript generally use the same-origin policy, which prevents data communication between web pages of different origins and loses the convenience of cross-domain data transfer

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Web page cross-domain communication method and device
  • Web page cross-domain communication method and device
  • Web page cross-domain communication method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0074] refer to figure 1 , shows a flow chart of a webpage cross-domain communication method according to an embodiment of the present invention, the method may specifically include the following steps:

[0075] Step 11. The first page with the first root domain name loads the second page with the second root domain name in an embedded manner in the first page.

[0076] In the embodiment of the present invention, the first page and the second page are webpages of different sources, that is, their webpage addresses have different root domain names. For example, the webpage address of the first page is www.so.com, and the corresponding first The root domain name is so.com, the webpage address of the second page is www.i.so.com, and the corresponding second root domain name is i.so.com.

[0077] Loading the second page in an embedded manner in the first page can be in any achievable manner, for example, by embedding an iframe frame, inserting "" statement; or use Scriptlets comp...

Embodiment 2

[0125] refer to figure 2 , showing a flow chart of a web page cross-domain communication method according to another embodiment of the present invention, the method may specifically include the following steps:

[0126] Step 21: The first page with the first root domain name loads the second page with the second root domain name in an embedded manner in the first page.

[0127] Step 22, the second page adds the target data from the second root domain name to the preset third page, and jumps to the third page, the root domain name of the third page is the first root domain name.

[0128] Step 23, the third page extracts the included target data originating from the second root domain name, and saves it in a storage space accessible to pages with the first root domain name.

[0129] Step 24: After the target data is saved in the storage space accessible by the page with the first root domain name, or after the loading of the third page is completed, the third page triggers an...

Embodiment 3

[0143] refer to image 3 , which shows a structural block diagram of an apparatus for webpage cross-domain communication according to an embodiment of the present invention, which may specifically include a first page 31 , a second page 32 and a third page 33 .

[0144] The first page 31 includes an embedded loading module 311;

[0145] The embedded loading module 311 is configured to load a second page with a second root domain name in an embedded manner in the first page on the first page with the first root domain name;

[0146] The second page includes a data adding module 321 and a page jump module 322;

[0147] The data adding module 321 is used for the second page to add the target data originating from the second root domain name to the preset third page, where the root domain name of the third page is the first root domain name;

[0148] The page jump module 322 is configured to jump to the third page;

[0149] The third page 33 includes a data extraction module 33...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a web page cross-domain communication method and device. The method includes the steps that a first page with a first root domain name loads a second webpage with a second root domain name in the first page in an embedding mode; the second page adds target data from the second root domain name into a preset third page and skips to the third page, and the root domain name of the third page is the first root domain name; the third page extracts the contained target data from the second root domain name and stores the target data in storage space which the pages with the first root domain name can have access to; the first page reads the target data from the second root domain name from the storage space. The communication between the cross-domain web pages in a browser is achieved, cross-domain file transmission, data sharing and data synchronization can be achieved, meanwhile, the development cost is lowered, and the problem that different root domain names are mutually embedded is solved.

Description

technical field [0001] The present invention relates to the technical field of webpage processing, in particular to a webpage cross-domain communication method and a webpage cross-domain communication device. Background technique [0002] In order to avoid security problems caused by mutual interference between web pages, in JavaScript, there is a very important security restriction called Same-Origin Policy (Same-Origin Policy), which prevents documents or scripts loaded from one source Gets or sets a property of a document loaded by another source. [0003] For example, http: / / www.360.cn / index.html and http: / / www.qihoo.com / index.html are respectively opened in the two tab pages of the browser, where JavaScript1 and JavaScript3 belong to sina script, and JavaScript2 is a script belonging to 163. When tab1 of the browser wants to run a script, it will perform a same-origin check, and only scripts with the same origin as www.360.com can be executed. Therefore, tab1 can only...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): H04L29/08G06F17/30
CPCG06F9/547G06F16/9566
Inventor 陈新
Owner BEIJING QIHOO TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products