Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery ajax() URL is required?

Tags:

jquery

ajax

the ajax function's header is: jQuery.ajax( url [, settings ] )

With the documentation saying that URL is required, why in the examples is only 'settings' supplied?

$.ajax({
  type: "GET",
  url: "test.js",
  dataType: "script"
});
like image 649
JorgeeFG Avatar asked Dec 02 '22 23:12

JorgeeFG


2 Answers

Right below that, you'll see the other syntax for $.ajax, where just a settings object is passed, including the URL.

like image 186
Paul Roub Avatar answered Dec 09 '22 03:12

Paul Roub


They provide two method signatures

jQuery.ajax( url [, settings ] )

jQuery.ajax( [settings ] )
like image 41
Explosion Pills Avatar answered Dec 09 '22 05:12

Explosion Pills