Comments (7)
try this...
...
,data: JSON.stringify(config)
,contentType: 'application/json'
...
from jquery-ajaxtransport-xdomainrequest.
Still not working.
The URL of web page is http://127.0.0.1:8085/?module=goagent&menu=config
.
The Ajax is code is:
$.ajax({
url: 'http://127.0.0.1:8084/config?cmd=set_config',
data: config,
contentType: 'application/json',
type: 'POST',
dataType: 'JSON'
}).done(function(result) {
console.log(result);
});
The Chrome returns the error message that XMLHttpRequest cannot load http://127.0.0.1:8084/config?cmd=set_config. Request header field Content-Type is not allowed by Access-Control-Allow-Headers.
.
from jquery-ajaxtransport-xdomainrequest.
@zjhzxhz sounds like you have to remove the contentType
option (since the XDR option does not set it).
from jquery-ajaxtransport-xdomainrequest.
@zjhzxhz Do you have CORS setup properly on the destination host?
from jquery-ajaxtransport-xdomainrequest.
I'm having the same issue, I have CORS setup properly on the destination host, I know this because I can directly use $.ajax()
to access it in Chrome when I'm not using your plugin. And now I want to add support for IE 8, and things become mysterious. Nothing is wrong with the scripts, but the server on the destination host receives 0 length request with no post data. And by manually executing $.ajax()
in developer tool, an error tell me that there is a 500 server error, yet my server receives no request.
from jquery-ajaxtransport-xdomainrequest.
When posting, the IE XDR object will only send the data as text/plain
, so your server has to be prepared to handle that.
from jquery-ajaxtransport-xdomainrequest.
Exactly. I've managed to solve this on my server side few momths ago. For Python flask server, the data is in request.data, and for Python pyramid server, the data is in request.text. All of which are not the usual way of getting parameters or POST data.
from jquery-ajaxtransport-xdomainrequest.
Related Issues (20)
- Missing main and ignore entries in bower.json HOT 1
- v1.0.3 release HOT 3
- code bug HOT 1
- Bower ignores un-minified version HOT 1
- Notseeing Content Type in IE HOT 5
- Package appears a bunch of times in bower search HOT 1
- Working example GET JSON not working HOT 1
- Parse error when loading SVG
- IE8 Always Failing HOT 5
- Is there an npm package for this? HOT 6
- IE 8: In case error, Not able to get Error Message HOT 1
- Post request not working in IE9
- Issue with gzip compressed data HOT 1
- Post Not working in IE9 HOT 1
- does this plugin support sending and receiving cookie? HOT 2
- How can i catch error message?
- ReadMe instructions link to CDNJS v1.0.3 not latest v1.0.4
- example does not work in IE9
- IE9使用此插件,依然进了error方法! HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-ajaxtransport-xdomainrequest.