#7519 closed feature (wontfix)
$.getCSS for v1.5
Reported by: | 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.
Change History (5)
comment:1 Changed 12 years ago by
Component: | unfiled → css |
---|---|
Priority: | undecided → low |
Status: | new → open |
comment:3 Changed 12 years ago by
Keywords: | ajaxrewrite added |
---|
comment:4 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | open → closed |
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.
comment:5 Changed 12 years ago by
Keywords: | ajaxrewrite removed |
---|
This might be interesting.