不可见的 Flash:通过使用不可见的 Flash Player 增强 Web 应用程序
2010-07-09 00:00:00 来源:WEB开发网清单 6. 调用 Twitter 搜索
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Calling Twitter from the client</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
function writeFlash(){
var attrs = {id : "JsHelper"};
swfobject.embedSWF("JsHelper.swf", "flashContainer", "1", "1", "10.0.0",
"playerProductInstall.swf", null, null, attrs);
}
function search(){
var keyword = document.getElementById("keyword").value;
var helper = document.getElementById("JsHelper");
helper.sendRequest("http://search.twitter.com/search.json?q=" + keyword,
"showResults");
}
function showResults(responseStr){
var response = eval("(" + responseStr +")");
var results = response.results;
alert("#Results = " + results.length);
}
</script>
</head>
<body >
<div id="flashContainer"></div>
<div id="inputDiv">
<label for="id">Search Twitter</label>
<input type="text" id="keyword" name="keyword"/>
<input type="button" value="Search Twitter" />
</div>
</body>
</html>
更多精彩
赞助商链接