dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
811

johnnyboyct
join:2003-06-11
New Britain, CT

johnnyboyct

Member

javascript window.opener

Hey guys,
Im working on a script that opens a window with an image chooser, then needs to put the path in a textbox. The problem is I THINK, that when the popup opens, you must select from a folder, which loads another page. Then that page has links that are supposed to insert the image.

The link that opens the popup looks like this:
<a href="#" onclick="javascript:window.open('dpv/index.php?insert=go', 'images', 'resizable=yes, scrollbars=yes, width=800, height=600, top=300, left=300, toolbar=yes, status=1, location=1');"><img src="img/imageInsert.gif" border="0" /></a>

The link under each image looks like this:
<a href="#" onclick="javascript:selectThis('100_6075.JPG');">Insert This Image</a>

The function is:
function selectThis(entry){
alert(entry);
window.opener.document.bgcolor="red";
}
(I just have the bgcolor to test, ive tried a few things)

Is it possible to open a popup that a user can change the page, then still be able to pass it back?

Any ideas?

Thanks alot,
John

JAAulde
Web Developer
MVM
join:2001-05-09
Frederick, MD
ARRIS SB6141
Ubiquiti EdgeRouter Lite
Ubiquiti UniFi AP

JAAulde

MVM

In a window that was opened by a script, opener should reference the window in which the open() call was made for as long as:
1) The window that was opened remains open
2) The window that called open() remains open

The location the windows should not make any difference.

Jim

PapaDos
Cum Grano Salis
MVM
join:2001-02-08
Drummondville, QC

PapaDos to johnnyboyct

MVM

to johnnyboyct
For security reasons, nowadays, I don't think you can use the opener property for anything unless the new window is a FRAME or an IFRAME of the original window...

JAAulde
Web Developer
MVM
join:2001-05-09
Frederick, MD
ARRIS SB6141
Ubiquiti EdgeRouter Lite
Ubiquiti UniFi AP

JAAulde

MVM

said by PapaDos:

For security reasons, nowadays, I don't think you can use the opener property for anything unless the new window is a FRAME or an IFRAME of the original window...
This is not a restriction that I have ever run into...

PapaDos
Cum Grano Salis
MVM
join:2001-02-08
Drummondville, QC

PapaDos

MVM

I am no expert in web page design, but I often create html Internet Explorer context menu extensions. The opener property is useless in that context, but it may be because of my Internet Explorer zones' setup.
Sorry if I am misguiding the OP...

JAAulde
Web Developer
MVM
join:2001-05-09
Frederick, MD
ARRIS SB6141
Ubiquiti EdgeRouter Lite
Ubiquiti UniFi AP

JAAulde

MVM

said by PapaDos:

I am no expert in web page design, but I often create html Internet Explorer context menu extensions. The opener property is useless in that context, but it may be because of my Internet Explorer zones' setup.
Sorry if I am misguiding the OP...
I'm no expert either and am not saying you are wrong when it comes to the latest versions of browsers. I was just saying I haven't hit the restriction before...but my testing is now showing me a roadblock somewhere...

Jim

johnnyboyct
join:2003-06-11
New Britain, CT

johnnyboyct

Member

hmmm, i wonder why it doesent work. Ill keep poking at it.

Thanks, John

PapaDos
Cum Grano Salis
MVM
join:2001-02-08
Drummondville, QC

PapaDos

MVM

One of the problems is the property you tried, "bgcolor" does not exist, try "bgColor".