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

Q599 How can I vary the *.js source file associated with the current page, but without loading the current page?

irt.org | Knowledge Base | JavaScript | Source | Q599 [ previous next ]

Q599 How can I vary the *.js source file associated with the current page, but without loading the current page?

You can do this by changing the location of another frame:

<frameset cols="100%,*">
<frame src="page.htm" name="html">
<frame src="source1.htm" name="source">
</frameset>

You can change the location of the source frameset from the html frameset with:

parent.source.location.href = source2.htm

In each source html file you can specify a different JavaScript *.js source file, e.g. in source1.htm:

<script language="JavaScript" src="source1.js"></script>

and in source2.htm:

<script language="JavaScript"><src="source2.js"></script>

You can utilise the relevant functions in the JavaScript source files from the html page with:

parent.source.functionName();

Feedback on 'Q599 How can I vary the *.js source file associated with the current page, but without loading the current page?'


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.