| Author |
Topic Search Topic Options
|
VBScript
Senior Member
Joined: 14 July 2004
Location: United Kingdom
Status: Offline
Points: 219
|
Post Options
Thanks(0)
Quote Reply
Topic: Javascript window.opener Posted: 20 July 2006 at 5:27pm |
|
I have a pop-up window and by using javascript I want to use the window.opener function to change the URL of the page that opened it.
How would I go about doing this?
|
|
|
 |
aks427
Mod Builder Group
Joined: 06 December 2003
Location: United States
Status: Offline
Points: 276
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 July 2006 at 7:40pm |
window.opener.location="url"; |
|
 |
VBScript
Senior Member
Joined: 14 July 2004
Location: United Kingdom
Status: Offline
Points: 219
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 July 2006 at 8:11pm |
Thanks!
|
|
|
 |
skwfalcon16
Groupie
Joined: 07 November 2004
Status: Offline
Points: 41
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 July 2006 at 7:36am |
So I'm using the old javascript pop-up window code that WWF use to use:
Javascript Code:
//Function to open pop up window function openWin(theURL,winName,features) { window.open(theURL,winName,features); }
ASP Code:
Response.Write (" <a href=""javascript:openWin('/dsp/includes/pop_up_event.asp?ID=" & rsEvent("Event_ID") & "','" & rsEvent("Event_Title") & "','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=400')"">")
|
It works just fine in FF, but throws an error in IE and won't open. I thought it might be pop-up blocker or something, but that didn't help. Any ideas?
|
|
|
 |
aks427
Mod Builder Group
Joined: 06 December 2003
Location: United States
Status: Offline
Points: 276
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 July 2006 at 3:18pm |
|
What is the error, and can you post the code that is actually outputted, instead of the ASP?
|
 |
skwfalcon16
Groupie
Joined: 07 November 2004
Status: Offline
Points: 41
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 July 2006 at 7:28pm |
My bad. Here is what the HTML looks like:
From FF: <a href="javascript:openWin('/dsp/includes/pop_up_event.asp?ID=14','Prospect Social','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=400')">Prospect Social</a>
From IE: <a href="javascript:openWin('/dsp/includes/pop_up_event.asp?ID=14','Prospect Social','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=400')">Prospect Social</a>
And the Javascript just for reference: //Function to open pop up window function openWin(theURL,winName,features) { window.open(theURL,winName,features); }
|
The error that is says is Line: 4 Character: 4 Error: "invalid argument" Code: 0 Here is the top 4 lines of the page too, but I don't think that has anything to do with it:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
And the open window function is the first one in my included javascript file, so I'm not real sure where the Line 4, Character 4 issue is. This one has me stumped...so odds are it's fairly simple.
|
|
|
 |
aks427
Mod Builder Group
Joined: 06 December 2003
Location: United States
Status: Offline
Points: 276
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 July 2006 at 8:05pm |
Your problem is coming in the new window's name. Firefox can accept a space, but IE can't.
For the name, do something like this instead.
Replace(rsEvent("Event_Title")," ","") |
Edited by aks427 - 28 July 2006 at 8:06pm
|
 |
skwfalcon16
Groupie
Joined: 07 November 2004
Status: Offline
Points: 41
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 July 2006 at 8:08pm |
|
Awesome!
Thank you!
(I knew it would be something simple...which is why I missed it)
|
|
|
 |