Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run same external script twice on the same html page

Status
Not open for further replies.

srhcpa

Programmer
Jun 30, 2010
1
US
Hi,

I have a piece of code that is in an external JS file that displays a series of images using an array. I want the same code, with different images to appear in two different places on my html page.

First, I have replicated the code in the same JS file and renamed all of the variables and anything else that looks like I need to differentiate it from the original code.

I have uploaded the js file to mediafire.

Aside from some var problem in the js file, I am confused on how to invoke the script from web page.

Using Firebug it looks like the ID calls it, but I also have to use the Body onload tag - probably b/c I have deactivated the load command in the code. As you can see I am chasing my tail here.

I am using the following to call the script:

<script type="text/javascript" src="javascript/ScrollingImages.js">changecontent2()</script> -->

Thank you for your help.

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top