Projects
View on GitHub
YMFE/cross-request
About
A chrome extension that gives the html page cross-domain request capability.
Web & App DevelopmentMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalA chrome extension that gives the html page cross-domain request capability.
一个赋予html页面跨域请求能力的chrome扩展
https://chrome.google.com/webstore/detail/cross-request/cmnlfmgbjmaciiopcgodlhpiklaghbok?hl=en-US
Api
crossRequest( options )
Usage
- GET
crossRequest({
url: 'http://caibaojian.com/ajax-jsonp.html',
method: 'GET',
success: function(res, header){
}
})
- POST
crossRequest({
url: 'http://127.0.0.1:3000/api',
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
data: {
a: 1,
b: 2,
c: {
t: 1
}
},
success: function (res) {
console.log(arguments)
}
})
- FILE upload
crossRequest({
url: 'http://127.0.0.1:8081/upload',
method: 'POST',
data: {
name: 'hello',
id: '19'
},
files: {
file: 'fileId' //File Upload-Input dom id
},
success: function (res) {
alert(res)
}
})
Explore related projects
Loading…