Skip to content

Instantly share code, notes, and snippets.

@libo1106
Created December 9, 2013 07:12
Show Gist options
  • Save libo1106/7868463 to your computer and use it in GitHub Desktop.
Save libo1106/7868463 to your computer and use it in GitHub Desktop.
通过给参数赋值undefined,可以让$.ajax不传该参数
$.ajax( 'api.demo.com/api' ,{
type: 'POST',
data: {
dateType: hasDateType ? DateType : undefined
},
dataType: 'json',
success: function(resp){
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment