|
hi!
how can I get to work 2 or more scripts that both use the .document in the source-code?
one without the other works fine, but as soon as I put them together only one works. (the one is a scroll-script with buttons and mouseover the other is with automatic scrolling content)
thnx for any help!
steffen.
|
|
|
Unless I don't understand your question, there is nothing that keeps you from using the .document object in as many scripts as you want in a single HTML page.
Here is an example of 2 scripts in one page that both use the .document object, and both work. You can copy and paste this as a new HTML file, then open it to see both scripts fire on page load.
<script language=javascript>
function Script1()
{
window.document.write("This line was written by Script1()<p>");
}
</script>
<body onload="Script1();Script2();">
</body>
<script language=javascript>
function Script2()
{
window.document.write("This line was written by Script2()<p>");
}
</script>
|
|
I put one script before the BODY and one after, but these could have been anywhere or both function in one script tag--it doesn't matter.
|
|
|
|
|
|
|
|
|
|
|
|