作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我必须从我的 ExtJs 脚本中执行 POST 以从我的数据库中删除某些内容:
Ext.Ajax.request({
url: 'deleteRole.html',
method: 'POST',
headers: {'Content-Type': 'text/html'},
waitTitle: 'Connecting',
waitMsg: 'Sending data...',
params: {
"rolename" : rolename
},
scope:this,
success: received,
failure: function(){console.log('failure');}
});
发送帖子时,我可以在 Firebug 中看到字体中的角色名称,但不是参数。我想向您展示另一篇关于用户注册的帖子(用 spring:form 制作)。如果我检查帖子,我可以看到以下内容:
最佳答案
问题是您使用的是 headers: {'Content-Type': 'text/html'},
行在你原来的问题中。这会将内容设置为 text/html 而不是发布数据的内容。
关于ajax - Extjs 4.2 : How to send parameters properly in a Ext. Ajax.Request POST,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17185814/
我是一名优秀的程序员,十分优秀!