<!DOCTYPE html>
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style type="text/css">
.box{
dispaly: none;
}
</style>
<script src='http://libs.baidu.com/jquery/1.9.1/jquery.js'></script>
<script type="text/javascript">
$(document).on('keyup', '#search', function(){
var sear = $(this).val();
$.ajax({
type: 'get',
url: 'http://suggestion.baidu.com/su?wd='+sear+'&p=3&cb=?',
dataType: 'jsonp',
jsonp: 'jsonpcallback',
jsonpcallback: 'fn',
success:function(data){
if(data !== 0){
$(".box").show();
var html = '';
$.each(data.s, function(k,v){
html+=v+'</br>';
});
$(".box").html(html);
}
}
});
});
</script>
<body>
<center>
<br />
<p style="font-size: 40px; color: red; font-family: 楷体;">搜索功能--长词尾</p>
<br/><br/><br/><br/>
<input type="text" id="search" style="width:600px; height:30px; line-height:30px; font-size:15px; border:2px #CCCCCC solid;" />
<div class="box" align="left" style="margin-left: 458px"></div>
</center>
</body>
</html>
百度长尾词
最新推荐文章于 2023-04-11 21:28:47 发布