惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
雷峰网
雷峰网
J
Java Code Geeks
G
Google Developers Blog
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
L
LangChain Blog
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
Vercel News
Vercel News
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
Y
Y Combinator Blog
博客园_首页
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
A
About on SuperTechFans
B
Blog
Microsoft Security Blog
Microsoft Security Blog

博客园 - oisiv

java线程池ThreadPoolTaskExecutor执行顺序 css一些特别效果设定 SQL模擬死結產生 base64编码的图片字节流存入html页面中的显示 设置span 宽度的完美解决方案 Mercurial hg web server的配置 DIV撑开 java.net.URLEncode编码 与 URLDecode解码问题 java在CMD环境下执行需注意字符集设定 把MSSQL的表数据查询成 insert into格式的函数 配置jboss4.2.3GA启用SSL html中DIv并排显示问题 鲁迅《兩地書》 java采用Apache FileUpload组件实现上传 js中对象复制以及apply方法的使用 可执行jar包的处理,以及could not find the main class win7/xp 双击执行jar包出现:could not find the main class的问题处理 MSSql性能优化 CSS拼装图片时,确保严丝合缝 在 SQL Server 2008 中新建用户登录并指定该用户的数据库
使用jquery模拟键盘事件,但window系统并不会真的响应事件,...
oisiv · 2016-04-11 · via 博客园 - oisiv
<!DOCTYPE html>
<html>
<head>
    <title>Demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#test").keyup(function(e){
                enterTest(e);
            });
           var e = jQuery.Event("keyup");//模拟一个键盘事件
            e.keyCode =91;//keyCode=91是win键
            $("#test").trigger(e);
        });

        function enterTest(e){

            if(e.keyCode==91){
                alert("Enter");
            }
        }
    </script>
</head>
<body>
    <input id="test" type="text"/>
</body>
</html>

posted on 2016-04-11 11:53  oisiv  阅读(401)  评论()    收藏  举报