Click here to Skip to main content
15,894,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey,

I have an mvc 2 application, and within a view there are a couple of different jquery posts to get data that is going to be populated in dropdownlists. The jquery post loading time is usually about half a second, but sometimes it can be two seconds. I was just wondering if there's some way to bind an event every time jquery's posting, so that I could turn the mouse courser into an hourglass when loading?

Thanks
Posted

1 solution

You can use jQuery.ajaxSetup to define a particular behavior which will be followed by all jQuery ajax calls made by your application.

JavaScript
$.ajaxSetup({ 
beforeSend:function(){
  /// change mouse cursor to hourglass
},
complete: function(){
  /// change mouse cursor to normal pointer
}});
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900