Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <1930181.aqSPkdTlGX@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Tue, 20 Dec 2011 12:14:48 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: cross-scripting issue: use javascript/DOM on iframe loaded from different domain, how? Newsgroups: comp.lang.javascript References: Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 41 NNTP-Posting-Date: 20 Dec 2011 12:14:50 CET NNTP-Posting-Host: 50c5891a.newsspool2.arcor-online.net X-Trace: DXC=ENRNS<3JPM\=>bdbdS?M0YA9EHlD;3YcR4Fo<]lROoRQ8kFIFKdLPRgS;EmcMGB5ST[ X-Complaints-To: usenet-abuse@arcor.de Xref: x330-a1.tempe.blueboxinc.net comp.lang.javascript:9447 Mike S wrote: > I have a page that contains an iframe which loads a page from a > different domain that I do not control. The iframe includes the > following select: > > > > I would like to be able to select AAA using javascript on the parent > page. I can work with the people who maintain the site that hosts the > page loaded into the iframe, so I'm wondering if there is some way that > they cold modify their page that would allow me to execute javascript on > it from my parent page? There is no "javascript" [1]. STFW for "Same Origin Policy". > Would including window.domain="mydomain.ext" in > the iframe page, where mydomain.ext is the domain hosting the parent > page, allow me to access the iframe DOM with javascript? No. It would be `document.domain', and it would not work everywhere; in particular in would not work if the second-level domain of your site was completely different from the second-level domain of the target site [2]. It is also in another way unreliable: the `domain' attribute of the HTMLDocument interface of W3C DOM Level 2 HTML that the object referred to by `document' implements, is specified as read-only [3]. PointedEars ___________ [1] [2] [3] -- realism: HTML 4.01 Strict evangelism: XHTML 1.0 Strict madness: XHTML 1.1 as application/xhtml+xml -- Bjoern Hoehrmann