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

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

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

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

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?'


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.