jQuery - script not running properly on initial AJAX load

Hello,

I’ve got a problem on a site using AJAX navigation where when you first request a page, parts of the script haven’t been executed, but if you visit again, it’s fine. Is there a common pitfall causing this problem?

Cheers,

Jon

Found the problem, the script is actually measuring the width of the content then displaying it with a controller to navigate through it. The problem is that it’s measuring the width before the images have loaded meaning that I’m getting the wrong result and causing the bug. I’ve dealt with this outside the AJAX call by using $(window).load() but this doesn’t seem to work within the AJAX call, any idea how I can delay the script until all the images have been loaded?

Cheers,

Jon