Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

return value from window

dr_freakdr_freak Member Posts: 7
hi everyone..

my window opens another window using the open() method..

i want the opened window to execute a func declared in the opener window when i close it.

my idea was to make the opened window return a string contains the name of the func to be executed. the opener have to execute it using eval(..)

any idea how to make it works?

waiting for replies...:)
thanx u all.

Comments

  • CyGuyCyGuy Member Posts: 312
    : hi everyone..
    :
    : my window opens another window using the open() method..
    :
    : i want the opened window to execute a func declared in the opener window when i close it.
    :
    : my idea was to make the opened window return a string contains the name of the func to be executed. the opener have to execute it using eval(..)
    :
    : any idea how to make it works?
    :
    : waiting for replies...:)
    : thanx u all.
    :

    [green]Yeah, but why would you want to do that? windows can communicate the same as working with forms... just give it a name. the original window object is assumed[/green]
    open()
    [green]is the same as[/green]
    window.open()
    [green]you may or may not know this.... just like you can do[/green]
    window.document.write("...");
    [green]but you must not know that a function is an object. when you create a function it is then an object. you can put a function inside a function and it becomes a method of that object. any way. the eval will then take that object/function and (i guess) execute the code. I don't see why you can't just call the function from parent or something. well, here is a link http://www.devguru.com/technologies/javascript/10855.asp
    good luck with that, let me know how it turns out
  • dr_freakdr_freak Member Posts: 7
    : you may like this site http://www.pageresource.com/jscript/jxtern.htm
    :

    hi again..

    thanx bro. i've solved it :):)

    i just called the fun. this way (in the opened window):

    eval("window.opener."+window.opener.FunToRun);

    where window.opener.FunToRun contains the name of the function on the parent window.

    see u..
Sign In or Register to comment.