calling a parent js function from a popup [Archive] - XML Elves

calling a parent js function from a popup

surfer97301
08-09-2004, 10:08 PM
Hi,

I generate a popup input window from the main svg
window and I want to have the onclick method of the
input form take the values of that form and call a
function in the svg's js.

I have tried opener.document.myjsfunction() and
opener.myjsfunction() but neither seem to work.

Any ideas?

I am having a hard time figuring out the correct
syntax for window ecma calls. What specs is the best
one to look at?

For instance it wasn't obvious to me that when calling
window.open() it won't work but calling open() will.

or that when dynamically creating my popup window that
var generator = open();
generator.document.write();
generator.document.write();

wouldn't work and needed to be:

var generator = open().document;
generator.write();
generator.write();

in order for more than one method to be used.

Thanks again!!!

Anonymous
08-10-2004, 12:52 AM
Hello surfer97301,

Personnaly i use opener.MyFunction(), and it works fine.

Try, if you have not done it, to put in your init function of your svg file:

parent.myjsfunction=myjsfunction;

Hope that works for you, seb.

surfer97301
08-11-2004, 04:41 PM
Thanks for the advice!

I'll have to give your technique a try. I ended up getting mine to work but I had to have the popup created outside of the svg and have it call into the svg instead of having the svg create the popup and the popup calling back into the svg.

Confusing getting all these docs to talk to each other.

 
Web mp2kmag.com
mapforums.com

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum