Skip to main content

Bug Tracker

Side navigation

#7519 closed feature (wontfix)

Opened November 15, 2010 10:33AM UTC

Closed January 09, 2011 04:09AM UTC

Last modified January 30, 2011 12:59AM UTC

$.getCSS for v1.5

Reported by: bmcouto@gmail.com Owned by:
Priority: low Milestone: 1.5
Component: ajax Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

Along with the $.getScript, it would be nice to have the same for loading css files and having a callback for it.

Basically, addind dataType: 'css' dp the $.ajax() method.

Attachments (0)
Change History (5)

Changed November 15, 2010 05:53PM UTC by rwaldron comment:1

component: unfiledcss
priority: undecidedlow
status: newopen

This might be interesting.

Changed November 21, 2010 02:23AM UTC by dmethvin comment:2

component: cssajax

Really an ajax enhancement as described.

Changed December 27, 2010 10:37PM UTC by rwaldron comment:3

keywords: → ajaxrewrite

Changed January 09, 2011 04:09AM UTC by jaubourg comment:4

resolution: → wontfix
status: openclosed

Determining when the stylesheet has been loaded is really tricky.

You obviously cannot use an xhr and create a style element since relative urls would be broken.

So you have to rely on link elements which are pretty inconsistent in the load detection department (I failed to find proper feature detection and had to resort to browser sniffing, though recent work with [algo] on script error detection gave me new ideas in that area).

The worst browser is probably Firefox, for which the code has to control some exception name (which incidently changed from 2.x to 3.x).

So it makes for some very cumbersome code for which error detection is a no go and the requests are prone to non-completion.

I had the css transport in the ajax rewrite initially but I dropped it for the reasons above and decided it was probably better suited for a plugin (since the new ajax is pluggable, it's pretty simple to externalize a transport).

I intend to publish the rejected transports (namely css, xdr and image) in the near future.

Adding a getCSS helper method sure makes sense, though.

Changed January 30, 2011 12:59AM UTC by jitter comment:5

keywords: ajaxrewrite