日期:2014-05-16  浏览次数:20473 次

帮我看看这个怎么调用
JScript code


<script language="javascript">
window.baidu.sug({q:"的",p:false,s:["的士高","的士速递","的士速递4","的繁体字怎么写","的士","的士高舞曲","的说","的士速递3","的卢","的故事"]});
</script>




让这些S里头的关键词

用这样形式<a href=""></a>依次全部舒服

------解决方案--------------------
window.baidu.sug在哪里定义的啊?
部分代码看不懂 啊!!!
------解决方案--------------------
JScript code
<script>
  onload = function() {
  var data="{q:\"的\",p:false,s:[\"的士高\",\"的士速递\",\"的士速递4\",\"的繁体字怎么写\",\"的士\",\"的士高舞曲\",\"的说\",\"的士速递3\",\"的卢\",\"的故事\"]}";
  data = window.eval("(" + data + ")").s;
  for(var i =0;i<data.length;i++) {
    document.getElementById('output').innerHTML += "<p>"+data[i]+"</p>";
  }
  }
</script>
<div id="output"></div>