日期:2014-05-17  浏览次数:20514 次

百度站内搜索 如何实现 iframe 形式的现实
下面的代码希望大家帮我看一下是什么意思??? 如果要改成我自己的站 需要怎么修改...

HTML code


<!--google search form begin-->

<script type="text/javascript" src="http://www.google.com/jsapi"></script> 
<script type="text/javascript"> 
 google.load('search', '1');
 google.setOnLoadCallback(function() {
   google.search.CustomSearchControl.attachAutoCompletion('partner-pub-0632032028768696:e6ey12umu6s',document.getElementById('q'), 'cse-search-box');
  });
</script>

<form action="http://www.wjapc.com/search.html" id="cse-search-box"> 
 <div> 
  <input type="hidden" name="cx" value="partner-pub-0632032028768696:e6ey12umu6s" /> 
  <input type="hidden" name="cof" value="FORID:9" /> 
  <input type="hidden" name="ie" value="UTF-8" /> 
  <input type="text" name="q" id="q" autocomplete="off" size="15" /> 
  <input type="submit" name="sa" value="&#x641c;&#x7d22;" /> 
 </div> 
</form> 

<script type="text/javascript" src="http://www.google.com.hk/cse/brand?form=cse-search-box&amp;lang=zh-Hans"></script> 
<!--google search form end--> 



<!--google search begin-->
<div id="cse-search-results"></div>
<script type="text/javascript">
  var googleSearchIframeName = "cse-search-results";
  var googleSearchFormName = "cse-search-box";
  var googleSearchFrameWidth = 960;
  var googleSearchDomain = "www.google.com.hk";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
<!--google search end-->



------解决方案--------------------
调用google搜索的api