Error when calling node.js from client side using $.ajax -


i'm trying make ajax call client that:

 $.ajax({         url: '/item/' + id + '/action?parameter=' + parameter,         method: 'get',         success: function(data) {           .....          } }); 

and error i'm getting is:

500 (internal server error) (from azure server (c["x-requested-with"]="xmlhttprequest");for(e in c)void 0!==c[e]&&f.setrequestheader(e,c[e]+""); (highlight)

the rest of site working well, ajax call returs error (tried post)

in server, i've done few attempts:
1)

cors = require('cors'), path = require('path'); var app = express(); app.use(cors()); 

2)

exports.action= function(req, res) {  res.setheader("access-control-allow-origin", "*"); res.setheader("access-control-allow-headers", "x-requested-with"); 

but still getting error


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -