Skip to main content

Bug Tracker

Side navigation

#6352 closed bug (wontfix)

Opened March 25, 2010 12:44PM UTC

Closed October 03, 2010 01:42AM UTC

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).

Attachments (0)
Change History (1)

Changed October 03, 2010 01:42AM UTC by addyosmani comment:1

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!