Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q958 How can I export and import functions, objects and properties?

irt.org | Knowledge Base | JavaScript | Misc | Q958 [ previous next ]

Q958 How can I export and import functions, objects and properties?

The following will export and import all of the functions, objects and properties from one frame to another. Note, that it requires the explicit JavaScript1.2 language to work, and it is only supported in Netscape Navigator, and then it does not work on the Unix platform.

<frameset cols="50%,*">
<frame src="test.htm">
<frame src="test2.htm">
</frameset>

In test.htm:

<script language="JavaScript1.2"><!--
function test() {
    alert('Hello World');
}

export *;
//--></script>

In test2.htm:

<script language="JavaScript1.2"><!--
import parent.frames[0].*;
//--></script>

<form>
<input type="button" onClick="test()" value="Test">
</form>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.