您的位置:首页 > 其它

搜狗云输入法对外提供调用体验

2010-10-11 10:59 162 查看
无意看到这个搜狗云输入法,提供对外调用,以下代码是个例子,不错哈。。。。。。
实现原理就是把您敲击的键实时传到远程服务器上去进行查讯,返回查讯结果。
[html]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>搜狗云输入法domo</title>
</head>

<body>
<h1>搜狗云输入法domo</h1>
<input type="text" onfocus="txtAreaClick(this)"/>
<pre>
<code>
function txtAreaClick(oTxtArea){
oTxtArea.value="";
oTxtArea.style.color = "#000";
try{
if(ime_close)return;
}
catch(e){
var ele=document.createElement('script');
ele.setAttribute('src','http://web.pinyin.sogou.com/web_ime/init.js');
document.body.appendChild(ele);
}
}
</code>
</pre>

<SCRIPT type="text/javascript">
function txtAreaClick(oTxtArea){
oTxtArea.value="";
oTxtArea.style.color = "#000";
try{
if(ime_close)return;
}
catch(e){
var ele=document.createElement('script');ele.setAttribute('src','http://web.pinyin.sogou.com/web_ime/init.js');document.body.appendChild(ele);
}
}
</SCRIPT>
</body>
</html>
[/html]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐