我的 jquery 代码可以在 ff、chrome、opera、safari 中运行,但在 ie 中不起作用。我收到的数据是 html 格式。我必须改变什么?
$("input[type='radio'][name='dishType']").change( function() {
var dishType = $(this).val();
$.post('index.py/ingredients', { 'q' : dishType}, function(data) { $('.ingredients').html(data)});
});
最佳答案
只有当您单击单选按钮之外的某个位置时,“change”事件才会在 IE 中触发。要解决此问题,您还应该监听“点击”事件。
关于jquery post 在 ie 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4633544/