codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  2 or more scripts  bmxsteffen at 16:58 on Friday, September 05, 2003
 

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.

  Re: 2 or more scripts  Troy Wolf at 20:33 on Friday, September 05, 2003
 

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.
Troy Wolf: site expert
SnippetEdit Website Editor


  Re: 2 or more scripts  Elain at 04:54 on Friday, December 03, 2010
 

I think you should describe your question clearly!
__________________________________________
logo maker|flash menu|drop down menu|flash decompiler mac








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: How to Remove the URL`s from printouts
•  Re: 2 or more scripts
•  Re: query can we
•  Re: Disbale edit
•  Re: How to get all the properties values of an object
•  Re: Catalog
•  Re: DHTML drop down menu
•  Re: Where do I find source code on this site?
•  Re: I need help with date validation


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010