• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

dynamic load with jquery

NukeULater

Gawd
Joined
Sep 12, 2006
Messages
917
Hello,

I am working on a website which dynamically loads content in order to swap between three slideshows. I am using this jquery script to run the slideshow.

http://buildinternet.com/project/supersized/

This code dynamically loads the three slideshows.

Code:
$(document).ready(function() {
        //initial 
      $('#content').load('content/pbr.php');               
        
        
        menu clicks
        $('ul#navbar li a').click(function() {
        var page = $(this).attr('href');
        $('#content').load('content/' + page + '.php');
        return false;                        
        });
});
The problem that I am having, is that once the three supersize scripts have been activated they run all at the same time instead of updating or closing the previously opened script. Thus, the slideshow runs incorrectly.

What do I need to include in my loading script that would turn off the already running scripts?

Any help is appreciated.
 
Before you load the new content, you could do:

Code:
$('#content').html('');

Or something like this would prolly be better:

Code:
$.ajax({
  url: 'content/' + page + '.php',
  datatype: 'html',
  success: function(data) {
    $('#content').html(data);
  },
  error: function(error) {
    console.log(error);
  }
});
 
Last edited:
Back
Top