tags:

views:

23

answers:

2

Hi,

My web page is divied into different section in that

in one section having images gallary.

to load the other section i am performing ajax calls. in following method.

$(document).ready(function(){ 
  // Perform other task here
} 

My issue is if image takes time to load other stub is waiting to load images.

I want to make image loading as secondary and my ajax stub on first priority.

Please suggest Thanks

A: 

$(document).ready does not wait for images to load.

douwe
A: 

Not sure if I understood your question, but wouldn't that be the case of:

$(document).ready(function(){ 
  Perform first task
  And now the second task
} 

One other thing you could do, is calling your image loader right at the bottom of the page, that way, it will be the last thing to be loaded.

OR

You could ad setTimeout, so the call to your function to display images would only happen x-seconds after the load.

Marcos Placona