Not Equal C && !=C && 不等于西
RSS icon Email icon Home icon
  • jQuery $.ajax()/$.get() function always get same value for IE

    Posted on June 19th, 2014 Sean Add comments

         When I was trying to use jQuery $.ajax() or $.get() function retrieve some random value from the server side, it’s working fine on firefox or chrome, but not IE. The server side code like below (written in ASP.NET MVC):

         The client side code:

         I’m supposed to get a random number every time I click the link, but in IE, always same one returned. Regarding Craic Computing’s Blog, that’s because IE will cache the value first returned, and trade rest requests as identical by default, so it won’t update the value since the request URL never change.
         To fix this issue, just disable cache in the jQuery function as following:

    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

    Leave a Reply

    Be the First to Comment!