jsFiddle /echo/html not working with jQuery
http://jsfiddle.net/YcK5X/ I'm wondering why this AJAX request doesn't return anything.
$.ajax({
type: 'POST',
url: '/echo/html',
data: 'Echo!',
开发者_开发百科success: function(data) {
$('#ajax').html(data);
},
dataType: 'text/html'
});
The data you want echo:ed must be supplied in a POST parameter named html:
$.ajax({
type: 'POST',
url: '/echo/html/',
data: {
'html': 'Echo!'
},
success: function(data) {
$('#ajax').html(data);
},
dataType: 'text/html'
});
精彩评论