コードがすり切れないようにしてください.

5636 ワード

//             ,     js        ,          、    、   


//       
document.oncontextmenu = function(event) { 

    if (window.event) { 

        event = window.event; 

    } 


    try { 

        var the = event.srcElement; 

        if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) { 

            return false; 

        } 

        return true; 


    } catch (e) { 

        return false; 

    } 

} 




//     
document.onpaste = function(event) { 
    if (window.event) { 

        event = window.event; 

    } 

    try { 

        var the = event.srcElement; 

        if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) { 

            return false; 

        } 

        return true; 

    } catch (e) { 

        return false; 

    } 

} 



//     

document.oncopy = function(event) { 

    if (window.event) { 

        event = window.event; 

    } 

    try { 

        var the = event.srcElement; 

        if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) { 

            return false; 

        } 

        return true; 

    } catch (e) { 

        return false; 

    } 

} 


//     

document.oncut = function(event) { 

    if (window.event) { 

        event = window.event; 

    } 

    try { 

        var the = event.srcElement; 

        if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) { 

            return false; 

        } 

        return true; 

    } catch (e) { 

        return false; 

    } 

} 


//     

document.onselectstart = function(event) { 

    if (window.event) { 

        event = window.event; 

    } 

    try { 

        var the = event.srcElement; 

        if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")) { 

            return false; 

        } 

        return true; 

    } catch (e) { 

        return false; 

    } 

}