Bug Tracker

Opened 10 years ago

Closed 9 years ago

#6352 closed bug (wontfix)

cache is not being false by default with datatype === "script"

Reported by: nsabena Owned by:
Priority: undecided Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: ajax cache script Cc:
Blocked by: Blocking:

Description

In jQuery 1.3.2, there was this test:

if ( s.dataType === "script" && s.cache == null ) {

s.cache = false;

}

which correctly set the s.cache value to false if s.cache was null OR undefined. In jQuery 1.4.2 this was changed to:

if ( s.dataType === "script" && s.cache === null ) {

s.cache = false;

}

(using exact equality) which no longer works when s.cache is undefined (most of the times). I think it should be reverted to the "==" comparer (s.cache == null).

Change History (1)

comment:1 Changed 9 years ago by addyosmani

Priority: undecided
Resolution: wontfix
Status: newclosed

In jQuery 1.4.2, as you mentioned, caching is disabled for script loads as it was decided this would be the most appropriate default option for all browsers.

It is however quite trivial to change this behavior as you're able to set cache:true in the options when creating an Ajax request.

$.ajax({

url: "test.html", cache: true, success: function(html){

$("#results").append(html);

}

});

Hope that helps!

Note: See TracTickets for help on using tickets.