By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,181 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

Iframes and getting their current URL within Subdomain

P: n/a
Hey all,

Quick question. My website is :

http://mywebsite:1234

and I load into an IFRAME this url :

http://anotherwebsite:2828

As you might have noticed they are both on the same domain (just not
fully qualified (ie. http://mywebsite.dmianname.com:1234)).

How do i access the URL of the IFRAME? I keep getting access denied.
I know I can't read the url of an IFRAME if the domains are
different... but in this case aren't they the same?

Thanks for any advice you can give.

Ryan Ritten
Jul 2 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
RyanRitten wrote:
http://mywebsite:1234

and I load into an IFRAME this url :

http://anotherwebsite:2828

As you might have noticed they are both on the same domain (just not
fully qualified (ie. http://mywebsite.dmianname.com:1234)).

How do i access the URL of the IFRAME? I keep getting access denied.
I know I can't read the url of an IFRAME if the domains are
different... but in this case aren't they the same?
The SOP does not consider DNS resolution. You have to use FQDNs instead,
and set document.domain appropriately. Alternatively, you may use
server-side URL rewrite so that it appears to the client that both resources
are from the same domain.
HTH

PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Jul 3 '08 #2

P: n/a
On Jul 3, 1:33*am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
RyanRitten wrote:
http://mywebsite:1234
and I load into an IFRAME this url :
http://anotherwebsite:2828
As you might have noticed they are both on the same domain (just not
fully qualified (ie.http://mywebsite.dmianname.com:1234)).
How do i access the URL of the IFRAME? *I keep getting access denied.
I know I can't read the url of an IFRAME if the domains are
different... but in this case aren't they the same?

The SOP does not consider DNS resolution. *You have to use FQDNs instead,
and set document.domain appropriately. *Alternatively, you may use
server-side URL rewrite so that it appears to the client that both resources
are from the same domain.

HTH

PointedEars
--
* * realism: * *HTML 4.01 Strict
* * evangelism: XHTML 1.0 Strict
* * madness: * *XHTML 1.1 as application/xhtml+xml
* * * * * * * * * * * * * * * * * * * * * * * * * * -- Bjoern Hoehrmann
Helps a bunch. thanks man :)
Jul 3 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.