calling a parent function

Javascript coding ..

Moderators: egami, macek, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 10
Joined: Fri Dec 13, 2002 2:22 pm

Thu Jan 16, 2003 7:57 am

what about if i want to make a call to a function defined in the parent window?? i mean i want that something happens in another window.



Sun Aug 31, 2003 9:05 pm

Assuming you want it to occure inside the parent window, but called from the child....

In Parent:

function accessProp()

In Child:

(button onclick, for example)

<input type=button value="Do it!" onclick="window.opener.accessProp()">

User avatar
php-forum Super User
php-forum Super User
Posts: 1279
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Sun Aug 31, 2003 9:54 pm

Make the function and save it in a .js file and then >>

IN the head tag use the following

Code: Select all

<script language=javascript src="givelocation/script.js"></script>

put the code wherever you want the script to execute


Mon Sep 01, 2003 12:29 am


The question (I believe :lol: ) was about calling it from a child window to act in the parent window, not just from or within itself :wink:

Post Reply