How can I put
onLoad=“P7_initTP(3,1);P7_TPurl()”
and
onLoad=“javascript:load_dates_values();”
into a external javascript file so I can call on both to work on the same page?
Thanks
How can I put
onLoad=“P7_initTP(3,1);P7_TPurl()”
and
onLoad=“javascript:load_dates_values();”
into a external javascript file so I can call on both to work on the same page?
Thanks
Just do this in your file:
P7_initTP(3,1);
P7_TPurl();
load_dates_values();
And preferably put the code they call also in the same file.
Then put the reference to this file at the bottom of the body just before the closing </body> tag.
<!-- body html -->
<script type="text/javascript" src="stuff.js"></script>
</body>
</html>
[FONT=Arial][SIZE=2]Here’s another great solution that’s been around the web for years. Well tested, and excellent crossbrowser functionality
function addLoadEvent(func) {
//assigns a variable for the onload event
var oldOnload = window.onload;
// checks to see if there is a function already assigned to onload
if (typeof window.onload != 'function') {
window.onload = func; // if not, onload executes the function
}
// otherwise the variable is called to run the previously called function(s)
else {
window.onload = function() {
if (oldOnload) {
oldOnload(); //calls the old function(s)
}
func(); //calls the new function
}
}
}
// Call the functions you want to insert, one per addLoadEvent
addLoadEvent(ecClock);[/SIZE][/FONT]
Seems to work great…
I thought it would need to be a function type setup to make it work.
Thanks