手写板 (调用百度接口)
生活随笔
收集整理的這篇文章主要介紹了
手写板 (调用百度接口)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1 <!doctype html>
2 <html>
3 <head>
4 <title>落日賭城</title>
5 <style>
6 #sx{color:#00C;text-decoration:underline;cursor:pointer;}
7 </style>
8 </head>
9 <body>
10 <form name="f" action="s">
11 <input type="text" name="wd" id="kw" maxlength="100">
12 <input type="submit" value="" id="su">
13 <span id="sx">手寫</span>
14 </form>
15 <script>
16 var w = window,d = document,n = navigator,k = d.f.wd
17 if (w.attachEvent) {
18 w.attachEvent("onload", function() {k.focus();})
19 } else {
20 w.addEventListener('load', function() {k.focus()},true)
21 };
22 var hw = {};
23 hw.i = d.getElementById("sx");
24 var il = false;
25 if (/msie (\d+\.\d)/i.test(n.userAgent)) {
26 hw.i.setAttribute("unselectable", "on")
27 } else {
28 var sL = k.value.length;
29 k.selectionStart = sL;
30 k.selectionEnd = sL
31 }
32 hw.i.onclick = function(B) {
33 var B = B || w.event;
34 B.stopPropagation ? B.stopPropagation() : (B.cancelBubble = true);
35 if (d.selection && d.activeElement.id && d.activeElement.id == "kw") {
36 hw.hasF = 1
37 } else {
38 if (!d.selection) {
39 hw.hasF = 1
40 }
41 }
42 if (!il) {
43 var A = d.createElement("script");
44 A.setAttribute("src", "http://www.baidu.com/hw/hwInput.js");
45 d.getElementsByTagName("head")[0].appendChild(A);
46 il = true;
47 }
48 };
49 </script>
50 <br />
51
52 </body>
53 </html>
以大多數(shù)人的努力之低,根本輪不到拼天賦。
總結
以上是生活随笔為你收集整理的手写板 (调用百度接口)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 计算机应用基础第2版在线作业1,计算机应
- 下一篇: html缩略文本,列表中展示富文本的缩略