i have created a page n am loading two pages on a div container with a button click using javascript. that i did, but my problem is when i click a button, i want the page to get loaded as well as to go to a specific position in that page. i have given [code] <a name>[code] to the ordered list n calling the link via a href. but javascript is calling first so the page gets loading n after that i have to click the link again for the page to show thwe correct location. both [code]<a name> [code]and javascript to load function is working but its not working simultaneously.
my code:
Code:
<div class=part>
<div class="part1">
<div class="span-19 last" id="response">
</div>
</div><!--part1-->
<div class="part2">
<div class="textwidget"><div id="call-button1"><a href="#">Get Started</a></div></div>
<div class="back1">
<div id="sidehed">Organized by Industry</div>
<ul id="testContainer">
<li class="plant"><a href="#plant">Plants and Refineries</a></li>
<li class="transmittt"><a href="#transmit">Transmission Lines</a></li>
<li><a href="#marine">Marine and Offshore</a></li>
<li><a href="#repair">More Repairs</a></li>
</ul>
<div id="sidehed">Organized by Repair Type</div>
<ul id="industries">
<li><a href="#corrosion">Corrosion Prevention</a></li>
<li><a href="#structure">Structural Repair</a></li>
<li><a href="#leak">Leak Repair</a></li>
</ul>
</div>
</div>
</div><!-- part -->
am loading two pages i.e repair type pge n industry page in [code]<div class="span-19 last" id="response">
</div>
[code] this div . i wanted to load poage 1 n pag3e 2 in this div as well as when i click on corrosion prevention it has to load that page in the div as well as go to that position of that page. am loading the page using javascript.
Code:
javascript:
$(document).ready(function(){
// load index page when the page loads
$("#response").load ("page1");
$("#testContainer").click(function(){
// load home page on click
$("#response").load ("page1");
});
$("#industries").click(function(){
// load about page on click
$("#response").load ("page2");
});
});
plz help