开发者

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'
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜