問題描述
google.elements.newsShow 顯示時間不起作用 (google.elements.newsShow display Time not working)
I am trying to use google newsShow api to display news in a html app. Here is the code
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http‑equiv="content‑type" content="text/html; charset=utf‑8"/>
<title>Google AJAX Search API Sample</title>
<script src="http://www.google.com/jsapi?key=AIzaSyA5m1Nc8ws2BbmPRwKu5gFradvD_hgq6G0" type="text/javascript"></script>
<script type="text/javascript">
google.load("elements", "1", {packages : ["newsshow"]});
function onLoad() {
// Set the display time to 2 seconds, and transition time to 100 ms
var options = {
"queryList" : [
{
"title" : "indian News",
"topic" : "n",
"ned" : "in"
}
],
"displayTime" : 1000,
"transitionTime" : 50
}
var content = document.getElementById('content');
var newsShow = new google.elements.NewsShow(content, options);
}
google.setOnLoadCallback(onLoad);
</script>
</head>
<body style="font‑family: Arial;border: 0 none;">
<div id="content"></div>
</body>
</html>
This code was working fine until yesterday. However this morning the display time is not working at all.
I referred to the example provided in this link, https://code.google.com/apis/ajax/playground/#timer_options
here too its not working, I remember very well how the news would get updated according the transition time.
I have tried all these things, 1. closed the browser n started again 2. restarted the system 3. checking the example on other desktops.
Yet nothings working. Totally unaware whats happening.
Could anyone help,
Thanks for ur time!!
參考解法
方法 1:
Google abandoned "newsshow". It had been deprecated for a long time but a few weeks ago newsshow just stopped working. I had to scramble to build a replacement for my sites.
Here is a Google News RSS replacement that in many ways is better:
http://www.gooplusplus.com/news‑frame‑guide.html
See this forum thread:
http://hypercube.us/forum/index.php?topic=1501.0