Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

calling a parent function

Javascript coding ..

Moderators: macek, egami, gesf

calling a parent function

Postby 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.

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

Postby primezero » Sun Jan 19, 2003 5:18 pm

i kinda know what you are talking about. but just to be sure, what exactly do you need?

:) thanks.
primezero
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sun Nov 17, 2002 5:59 pm
Location: Scottsdale, AZ

Postby 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:

<script>
function accessProp()
{
whatever.............;
}
</script>

______________________
In Child:

(button onclick, for example)

<input type=button value="Do it!" onclick="window.opener.accessProp()">
cw4908
New php-forum User
New php-forum User
 
Posts: 5
Joined: Sun Aug 31, 2003 3:06 am

Link

Postby 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
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Postby cw4908 » Mon Sep 01, 2003 12:29 am

ruturajv,

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:
cw4908
New php-forum User
New php-forum User
 
Posts: 5
Joined: Sun Aug 31, 2003 3:06 am


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron