Home > Web Front-end > HTML Tutorial > The page in the iframe to set the attributes of the iframe (width, height)_html/css_WEB-ITnose

The page in the iframe to set the attributes of the iframe (width, height)_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:09:16
Original
1306 people have browsed it

a.htm is the page to be nested. There is an iframe in b.htm that nests a.htm
I want to set the width of the iframe in b.htm through js in a.htm. , height

$(parent.window).width(1000);
Copy after login


Due to the same origin policy, the operation encountered an error: permission denied. (not the same domain name)
Is there any way to set b.htm in a.htm? This iframe (an iframe nested in a.htm)?

(Because we want to provide a widget, we give users this code: , but I want to have less code. I can't use js on the user's page (b.htm), all I can control is a.htm)


Reply to the discussion (solution)

Cross-domain will not work

It involves cross-domain. . . Not easy to handle. .

http://www.chinaz.com/web/2011/1123/222158.shtml
This can completely meet your requirements.

Thank you everyone, I learned a lot of methods.

But I don’t have any control over b.htm (that is, I cannot add any js to b.htm or create files in this directory) , The method I found is to add js to b.htm to change the attributes of iframe

Thank you everyone, I learned a lot of methods.

But I don’t have any control over b.htm (that is, you cannot add any js to b.htm or create files in this directory). The method I found is to add js to b.htm to change the attributes of the iframe
Do not add anything to b, no That’s easy

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template