Get Page address from within iFrame

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
IrakliG
Forum Newbie
Posts: 1
Joined: Sat Jun 26, 2004 4:35 am

Get Page address from within iFrame

Post by IrakliG »

Hi all,

I have a html page - test1.htm which has an iframe in it and in some case it showes scr="test1.php"
In the Test1.PHP I need to get address of the current page in this example test1.htm
How??????
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Moved to client-side.

Try Javascript: alert(top.location.href);
jollyjumper
Forum Contributor
Posts: 107
Joined: Sat Jan 25, 2003 11:03 am

Post by jollyjumper »

or parent.document.location if the iframe element is in the test1.html file.
Post Reply