码迷,mamicode.com
首页 > 移动开发 > 详细

移动端不允许提交emoji表情判断

时间:2016-05-05 12:47:56      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
    <meta content="telephone=no" name="format-detection" />
    <title>移动端不允许提交emoji表情判断</title>
<style>
*{
    padding:0;
    margin:0;
}
.emoji_box{
    padding:10px;
}    
textarea{
    width:100%;
    height:100px;
}
input{
    width:100%;
    height:30px;
}

</style>
</head>
<body>
    
    <div class="emoji_box">
        <!-- <form action="emoji.php"> -->
            <textarea name="text" id="text"></textarea>
            <input type="submit" value="提交" id="btn">
        <!-- </form> -->
    </div>

<script type="text/javascript">
    var btn = document.getElementById(btn) ,
        text = document.getElementById(text) ;

    btn.onclick = function(){

        var val = escape( text.value ).toLocaleLowerCase() ;

        if( val.match(/(\%\ue[0-9a-f]{3})|(\%\ud[0-9a-f]{3})/) ){
            alert(‘不允许提交表情‘);
        }else{
            alert(提交)
        }
                
    }
</script>
</body>
</html>

 

移动端不允许提交emoji表情判断

标签:

原文地址:http://www.cnblogs.com/zion0707/p/5461160.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!