CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   plz plz help..... (http://www.codingforums.com/showthread.php?t=283432)

natashajne 12-03-2012 07:58 AM

plz plz help.....
 
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

devnull69 12-03-2012 12:14 PM

please reformat your code

- The closing tag for [ code ] is [ /code ]. This can also fix your indentation issues ...
- The inline code tag is [ icode ]
- The English language sometimes makes use of uppercase characters ... which sometimes make a big difference (for example if you want to help your Uncle Jack off a horse)

DanInMa 12-03-2012 01:44 PM

try load.("page1.htm") you need to include the full file name.

natashajne 12-04-2012 06:31 AM

I have given correct url for page1, Here i just written page 1 instead of the full url, actually my code n url is working fine but its not taking me to the correct position at the time of loading the page, i.e javascript is working first n then <a name> tag. i want both to work simultaneosly. so that i dont have to double click the link. just click on the link so it 'll load the page in the div container as well as take me to the correct position of the heading in the page. can anyone plz help...


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.