SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Grab Parent URL
-
Jul 9, 2006, 19:01 #1
- Join Date
- Jul 2006
- Posts
- 5
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Grab Parent URL
Alright so I have a popup, and I need a javascript code that will
1) Grab the parent URL (The URL of the page that has the link that opens the popup)
2) Put that URL into a hidden form
Anyone know how to do this?
Thanks.
-
Jul 9, 2006, 19:19 #2
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
The popup page should contain the following:
<body onload="document.getElementById('parenturl').value = opener.location.href;">
<form>
<input type="hidden" name="parenturl" id="parenturl">Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Jul 9, 2006, 19:26 #3
- Join Date
- Jul 2006
- Posts
- 5
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you. I've been hunting everywher for this!
Bookmarks