Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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
    Last edited by VIPStephan; 12-03-2012 at 12:39 PM. Reason: fixed code BB tags

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,396
    Thanks
    12
    Thanked 569 Times in 562 Posts
    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)

  • #3
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    try load.("page1.htm") you need to include the full file name.

  • #4
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •