0

I want to ask is that any good AJAX jQuery code for .load()

I am using .load() method to call over other file into certain div id by onclick="myfunction()" and it always need to hold awhile for progress.

Now what i want to do is how to add something while the progress, for better performance.

Any ideal guy ^^

before that thx for read it.

som
  • 4,650
  • 2
  • 21
  • 36
Diaz Lv
  • 27
  • 1
  • 4

2 Answers2

0

Use the ajaxSend and ajaxComplete methods. Further reading: http://api.jquery.com/ajaxSend/

reggaemahn
  • 6,272
  • 6
  • 34
  • 59
0

You can use the callback on .load() see JQuery .load() callback function. Then simply display the loading animation before you call .load() and then hide it in the callback.

A real progress bar with percentage is a bit more cumbersome.

Community
  • 1
  • 1
EJTH
  • 2,178
  • 1
  • 20
  • 25