Link to home
Start Free TrialLog in
Avatar of leadwave
leadwaveFlag for Canada

asked on

Multiple AJAX scripts/functions in one page only runs last function

I've got a page with 3 divs that I need filled using AJAX.  So I've got 3 js functions to accomodate that.  This is how I've got the section of the page:

<div id="Sect1"></div>
<script type="text/javascript">loadSect1();</script>

<div id="Sect2"></div>
<script type="text/javascript">loadSect2();</script>

div id="Sect3"></div>
<script type="text/javascript">loadSect3();</script>

------------
The problem I'm having is that only the last javascript function seems to be executing.  If I re-order the divs with say, Sect1 being last, then that function runs fine, but none of the other 2.  I've included an onclick event on each of the divs and that works but I don't want users to have to click each section to load the data.

What am I missing here?

I thank you in advance.
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of leadwave

ASKER

Thank you.  I knew I was missing something.  I simply created a new instance of the object and everything works great.