开发者

Retrieve the complete URL from an iFrame [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

How do I g开发者_运维知识库et the current location of an iframe?

Hi i want to get the complete URL, and with the methods i know i get the full url but of the iframe, and i want the 'final' document.location.href,

how can i get it?

i don't care if its php or js, but i'm guessing by my experiments that with PHp it's not possible...


If you want to know where you currently are:

  • Client side - javascript - you can use alert(window.location).
  • Server side - php - .$_SERVER["REQUEST_URI"] or $_SERVER['PATH_INFO'] depending on what you want.


Take a look at the top answer from this question.

It's important to note that it's (luckily!) not possible to get the URL of an iframe if the iframe's URL is from a different domain than the parent page. If you're trying to do that, you're probably out of luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜