Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Cross-domain IFRAME height self-adaption method

An adaptive and high-level technology, applied in the field of WEB development, can solve problems such as insufficient permissions and inability to operate across domains, and achieve the effect of solving the problem of cross-domain operations.

Inactive Publication Date: 2015-03-04
G CLOUD TECH
View PDF3 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, in the case of cross-domain, because the client-side JavaScript is restricted by the complete policy of the browser, the nested page will have insufficient permissions when obtaining or modifying the DOM properties of the parent page, that is to say, JavaScript can only operate the same Attributes under the domain, but cannot operate across domains

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
  • Cross-domain IFRAME height self-adaption method
  • Cross-domain IFRAME height self-adaption method
  • Cross-domain IFRAME height self-adaption method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0018] like figure 1 As shown, the present invention specifically comprises the following steps:

[0019] Step 1: Create access main page m and transit page a under domain A (www.A.com), remove all HTML codes in the tags in page a;

[0020] key code:

[0021] iframe main page: m.html

[0022]

[0023] Step 2: Create a page b to be embedded under domain B (www.B.com), add a hidden IFRAME, set the width and height to 0, and then when the page is loaded, JS gets the height of the page and saves it, and Set the src attribute of the hidden IFRAME as a link to transfer page a under domain A, and at the same time, add the height of page b as a parameter to the back of the link for transmission;

[0024] key code:

[0025]

[0026] Step 3: Add an IFRAME tag to page m created in step 1, set the height to automatic, and its src attribute points to the access link of page b created in step 2 to be embedded;

[0027] key code:

[0028]

[0029] Step 4: Get the IFRAME object i...

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 relates to the technical field of WEB development, in particular to a cross-domain IFRAME height self-adaption method. The method sets a transit page a under a domain A, and nests the transit page a into a page b under a nested domain B, while the page b is nested into a main interface m under the domain A. When the page m is accessed by a browser, the page b is loaded, an onload event of the page b is triggered to obtain the height of the page, the page a is then loaded into the page b, the height of the page b is assigned as a parameter to the location object of the page a, and thereby the page a can obtain the height of the page b through location.hash. The cross-domain IFRAME height self-adaption method solves the problem that the height of the IFRAME cannot be automatically adapted in the process of WEB development when a page is nested into the IFRAME across domains, and can be widely applied in WEB development.

Description

technical field [0001] The invention relates to the technical field of WEB development, in particular to an IFRAME cross-domain highly self-adaptive method. Background technique [0002] In the process of WEB development, it is often encountered that IFRAME is used to embed other page content, and it is easy to set its height through JavaScript under the same domain. However, in the case of cross-domain, because the client-side JavaScript is restricted by the complete policy of the browser, the nested page will have insufficient permissions when obtaining or modifying the DOM properties of the parent page, that is to say, JavaScript can only operate the same Attributes under the domain, and cannot operate across domains. Contents of the invention [0003] The technical problem to be solved by the present invention is to provide an IFRAME cross-domain highly self-adaptive method and solve the problem of cross-domain operation. [0004] The technical scheme that the presen...

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): G06F17/30
CPCG06F8/20G06F16/958
Inventor 丁继锋徐震宇孙傲冰季统凯
Owner G CLOUD TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products