<script language="javascript" type="text/javascript">


function updateonlines()
{alert('you are updating the online users set the user field to online');}
function updateofflines()
{alert('you havve to set the online users to offline when they leave the page');}
window.onload = updateonlines;
window.onload = updateofflines;
</script>

SORRY NEW PROBLEM! I FIXED IT IT WORKS. but i have a question, can i use window.onload twice? like the above?

Recommended Answers

All 2 Replies

You can just use a function that calls different functions, example:

<script type="text/javascript">
function sayHi() {
alert("Hi");
}
function sayHello() {
alert("Hello");
}
function callHelloHi() {
sayHi();
sayHello();
}
window.onload = callHelloHi();
</script>

~G

thanks thats good to know.

You can just use a function that calls different functions, example:

<script type="text/javascript">
function sayHi() {
alert("Hi");
}
function sayHello() {
alert("Hello");
}
function callHelloHi() {
sayHi();
sayHello();
}
window.onload = callHelloHi();
</script>

~G

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.