Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q64 How do I pass parameters to a script defined in a file?

You are here: irt.org | FAQ | JavaScript | Source | Q64 [ previous next ]

Suppose your ../library.js file contains:

function myFunction(myParameter1,myParameter2) {
    var x = myParameter1 + myParameter2;
    return x;
}

Then with your html document you need:

<script src="../library.js">
</script>

<script language="JavaScript"><!--
alert(myFunction(2,2));
//--></script>

Feedback on 'Q64 How do I pass parameters to a script defined in a file?'

©2018 Martin Webb