SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with .load() , toggle() please

    1. How do i stop the external page from loading over and over again after a user clicks on #testlink link

    2. How can i impliment toggle() so that when my external page is loaded the next time a user clicks on the #testlink link it will collapse the #container div

    3. How can i pass $testlinkvariable onto the .load() function so i can use that variable in the external page as to get data


    THNAKS

    main
    Code:
     <html>
    <head>
     <script> 
     function updateElement(el_id, action) {
    
         $('<div id="info" />').load('http://www.site.com/new_file.html #movies', function() {
          $(this).appendTo('#container')
            .slideDown(1000);
          });
          
          return false;
        
       };
    </script> 
    </head>
    <bodY>
    
    <div id="container"></div>
    <a id="testlink" onclick="javascript:updateElement('<?php echo $testlinkvariable ?>','');">Test Link</a>
    </body>
    </html>

    new_file.html
    Code:
    <ul id="movies">
    <li style="font-weight: bold; list-style-type: none;">My Favorite Movies</li>
    <li>Contact</li>
    <li>Shawshank Redemption</li>
    <li>Napoleon Dynamite</li>
    <li>Back To The Future</li>
    <li>The Goonies</li>
    <li>Cinderella Man</li>
    <li>Apollo 13</li>
    </ul>

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Resolved


Bookmarks

Posting Permissions

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