jAlert没有在IE中调用

时间:2013-01-21 09:24:08

标签: javascript jquery jquery-ui

我通过在键盘中输入回车键来验证文本框。验证工作正常,但JAlert没有显示。但是当我在按钮上调用相同的功能时,它会在IE中显示警报。我完全对此感到困惑。谁能帮我? demo

function isEnterPressed(event) {
        var keynum;
        if (window.event) {
            keynum = event.keyCode;
        }else if (event.which) {
            keynum = event.which;
        }
        if(keynum == 13) {
            searchSubmit();
        }
    }

searchSubmit()是按钮单击时的函数调用

function searchSubmit()
{
    // some valdation
  if(!flag) 
    {
    alert('flag'+flag);
    jAlert("Enter anyone of the value to search");
    return false;  
    }else{
    document.userManagementUsers.action=baseUrl;
    document.userManagementUsers.submit();
    }
 }
通过单击输入键显示

alert('flag'+ flag)jalert未执行。

1 个答案:

答案 0 :(得分:0)

你尝试过这样的事吗?

$('body').jAlert('Enter anyone of the value to search', 'success'); 

$(document).ready(function() {
  $('body').jAlert('Enter anyone of the value to search', "success");
});