Looking for a way to call a function from an external JavaScript file?
Here are the specifics:
- Within the head tag, include the following script:
<script type="text/javascript" src="JScript/FontSize.js"></script>
The
FontSize.js
file you want to call contains these functions:function checkCookie() function setCookie(c_name, value, expiredays) function getCookie(c_name) function increaseFontSize() function decreaseFontSize()
The FontSize.js is located in the
~/Jscript/
directory
To make the call to the function from the external JavaScript file, include something like this in the body onload attribute:
<body onload="/JScript/Fontsize.js/checkCookie()">
If things aren't working as expected, it could be because of how the call to a function in an external JS file is made.