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

top.location from iframe with src ssl

100+
P: 130
hello all.

is there a way to get the window.top.location if the current location is https://...?

parent.html will call am iframe with src="https://www.testtest.com/sun.html"

sun.html
should alert the url that opened it.

without the https its working.

is there a way?

thanks
Apr 30 '09 #1
Share this Question
Share on Google+
11 Replies


acoder
Expert Mod 15k+
P: 16,027
Is it from the same domain?
Apr 30 '09 #2

100+
P: 130
no, its not
the parent can be http://www.google.com
the iframe can be https://www.aol.com
Apr 30 '09 #3

acoder
Expert Mod 15k+
P: 16,027
Normally, http wouldn't be allowed cross-domain either. Are you testing locally?
Apr 30 '09 #4

100+
P: 130
thanks for you patines,
not sure what you mean by localy :\
i just buikd the iframe and i want other websites to use it,
i also want to know what wbsite uses it
still no one use it
Apr 30 '09 #5

100+
P: 130
no edit :\

i just test it and its not working even in http :(
not sure what i saw that i thought it did.

anyway is there a away to round it?
Apr 30 '09 #6

acoder
Expert Mod 15k+
P: 16,027
Yes, that's what I thought. There are ways around it. One is to serve the page from your domain, e.g. by using Curl. If you control both domains, there was a recent thread that you could look at. If I find it, I'll post it here.
Apr 30 '09 #7

100+
P: 130
Curl is a nice idea and it might even work :) but i only have control over the iframe and not on the pages that will call it, i am not even sure that its php page that will call it.

i know i can always ask to attached the domain to the iframe src and then
window.location.search
but i dont want to trust other for my logs.
i want my code to be able to do that
May 1 '09 #8

acoder
Expert Mod 15k+
P: 16,027
In that case, it's not going to work. The way Curl would've worked is that you control the main page domain and serve the iframe content from your domain.
May 1 '09 #9

100+
P: 130
beside curl, is there away?
May 2 '09 #10

acoder
Expert Mod 15k+
P: 16,027
Perhaps what you can do is have the sites include your iframe via a script, so the script would create the iframe and pass on the URL to the src.
May 2 '09 #11

100+
P: 130
yeah good idea
thanks acoder
May 2 '09 #12

Post your reply

Sign in to post your reply or Sign up for a free account.