Click to See Complete Forum and Search --> : Calling remote functions.


dragonninja
11-07-2003, 02:24 AM
Ok, would anyone here like to help me out.
Is it possible to call data and or functions from another HTM file into the browser from the file you are already in.
If so how do you do it?

Gollum
11-07-2003, 02:58 AM
Yes it is possible, but with restrictions.

The first question is though, why are you doing this?

Is it to access some form data in some popup? If so then all you need to do is store the window pointer when you create the popup and then later you can call any functions defined within it - in fact any javascript defined at global scope become properties of the window object...

var w = window.open('myPopup.html', ...);
...
w.someFunctionDefinedInMyPopupDotHTML('whatever');


If however, you are doing this to reuse the function instead of redefining it in every HTML page, you should move your commonly used Javascript into its own file and reference it from each page that uses it like this...

<script type="text/javascript" src="myJavascript.js"></script>