User javascript to catch ctrl in IE and Firefox

for Firefox:

function selectRow(obj, id, rowID, e) { // maybe 'e' should put last
            if ($.browser.mozilla) {
                var event = e;
                if (event.ctrlKey == true) 
                {
                     // do something here
                }
             }
}

 

for IE:

function selectRow(obj, id, rowID) { // the 'e' not need
    if(window.event.ctrlKey) {
        // do something here
    }
}

 

posted @ 2012-03-20 13:46  minglz  阅读(517)  评论(0编辑  收藏  举报