10th Oct, 2009

Google Custom Search 唔 work


Google Custom Search 提供個 Host results on my website using an iframe 既 sample code 有問題, googleSearchFrameWidth 就算你 set 乜 value 都係冇用:

1
2
3
4
5
6
7
8
9
10
11
<div id="cse-search-results"></div>
<script type="text/javascript">
  var googleSearchIframeName = "cse-search-results";
  var googleSearchFormName = "cse-search-box";
  var googleSearchFrameWidth = 600;
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript" 
           src="http://www.google.com/afsonline/show_afs_search.js">
</script>

個 result 都會爆到好大。

解決方法:

1
2
3
4
5
6
<style type="text/css">
#cse-search-results iframe 
{
         width: 580px;
}
</style>

相關文章

回應

謝謝啦,我有用到^^

zing on 2010-03-09 16:54

你的回應






Your response: