烙印99
前端代码:$(document).ready(function() {$.ajax({url: '127.0.0.1:1337', //不知道这个url到底应该填什么dataType: "jsonp",data: '{"data": "TEST"}',type: 'POST',jsonpCallback: 'callback',success: function (data) {var ret = jQuery.parseJSON(data);console.log('Success: '+ret.msg)},error: function (xhr, status, error) {console.log('Error: ' + error.message);},});});后端代码:var http = require('http');var util = require('util')http.createServer(function (req, res) {console.log('Request received: ');res.writeHead(200, { 'Content-Type': 'text/plain' });req.on('data', function (chunk) {console.log('GOT DATA!');console.log(data);});res.end('callback(\'{\"msg\": \"OK\"}\')');}).listen(1337,'127.0.0.1');console.log('Server running on port ');