Skip to content

wushufen/ajax.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ajax.js

ajax 插件

usage

xhr = ajax({
  url: 'url',
  type: 'post',
  headers: {
    'Content-Type': 'application/json'
  },
  responseType: '',
  data: { // 内部会根据头部自动转成对应的格式
    key: 'value'
  },
  success: function(res){  
    console.log(res)
  }
})