2

For example with jQuery 1.5.2 or smaller this code will log 'ololo' in FireBug console:

$.get(
'some_url', 
{ data: 'some_data' }, 
function() { 
   console.log('ololo') 
}, 
'script')

Same with .ajax (any type of request), .post

But with jQuery 1.6-1.6.1 the callback does nothing. However, the callback will be launched if data type is anything except 'script'. For example, 'json' or 'html.'

I have not been able to find something concerning this on http://api.jquery.com/jQuery.get/

Jack B Nimble
  • 5,039
  • 4
  • 40
  • 62

1 Answers1

0

I think the "script" datatype makes jquery behave like getScript() which

Load a JavaScript file from the server using a GET HTTP request, then execute it.

To me that means that no callback will be called, as the script will be executed.

Diederik
  • 5,536
  • 3
  • 44
  • 60