Bug Tracker

Modify

Ticket #10082 (closed enhancement: wontfix)

Opened 3 years ago

Last modified 3 years ago

'style' or 'css' dataType in $.ajax().

Reported by: min@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

If there was a 'style' or 'css' dataType in $.ajax(), it would be simpler to dynamically load CSS stylesheets. It would do something like:

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

Change History

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to wontfix

The problem with adding more functionality to $.ajax() is that people would expect it to be compatible with the dozens of options supported there. That is a tall order.

I'd suggest this start as a plugin or $.ajax extension outside core and be incorporated once the need is demonstrated and the problems are worked out.

Just use the code you've proposed there if it's good for your needs.

comment:2 Changed 3 years ago by rwaldron

Lucky for you, Julian Aubourg has already written this:  https://github.com/jaubourg/ajaxHooks

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.