我正在使用Jquery 1.5来操作表单,我一直在IE 7中收到以下错误
Object doesn't support this property or methood
Line: 10, Char: 0
我使用以下代码:
Line 8: $(':input[name=firstname], :input[name=lastname], :input[name=middlename]').blur(function(){
Line 9: var fullName = $(':input[name=firstname]').val().trim() + " " + $(':input[name=middlename]').val().trim() + " " + $(':input[name=lastname]').val().trim();
Line 10: $(':input[name=sys_title], :input[name=displaytitle]').val(fullName);
Line: 11: });
有没有人知道为什么它会在IE7中失败而不在FF中?
由于
答案 0 :(得分:1)
$.trim()不起作用。
$(':input[name=firstname]').val().trim()
无效。
$.trim($(':input[name=firstname]').val())
可以使用。
答案 1 :(得分:0)
使用IE7,我认为模糊事件不起作用,你必须处理类似的事情:
$('input[name=firstname]').bind('focusout', function(){
alert('focusout');
});
您在JQuery页面中获得了更多信息:
The focusout event is sent to an element when it, or any element inside of it, loses focus. This is distinct from the blur event in that it supports detecting the loss of focus from parent elements (in other words, it supports event bubbling).