calling a parent function

Javascript coding ..

Moderators: macek, egami, gesf

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

calling a parent function

Post by fabrizzio » 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.



Post by cw4908 » 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: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India


Post by ruturajv » 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


Post by cw4908 » 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

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest