Skip to main content

Bug Tracker

Side navigation

#10596 closed bug (invalid)

Opened October 27, 2011 12:30PM UTC

Closed October 27, 2011 02:06PM UTC

JQuery Ajax always fail while loading a cs sfile

Reported by: anonymous Owned by:
Priority: low Milestone: None
Component: ajax Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:
Description

If you try something like:

$.ajax({

url: url

, dataType: "css"

, crossDomain: true

, success: function() {

$("head").append("<link rel='stylesheet' href='" + url + "' type='text/css'/>");

}

});

it will always fail.

Attachments (0)
Change History (1)

Changed October 27, 2011 02:06PM UTC by rwaldron comment:1

component: unfiledajax
priority: undecidedlow
resolution: → invalid
status: newclosed

There is no dataType "css" see: http://api.jquery.com/jQuery.ajax/

If you want to load CSS, I recommend: https://github.com/jaubourg/ajaxHooks