我无法将autosuggest脚本嵌入到我现有的php文件(wordpress)中。以下是代码,这是期望的结果http://www.emposha.com/demo/fcbkcomplete_2/ 另外,stackoverflow的标签系统很棒,我看起来像这样:D
Howvere,而不是文本字段,我得到一个选择字段。它可能是javascript的东西,我不知道......
代码:
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>FCBKcomplete Demo</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8" />
<script src="http://code.jquery.com/jquery-1.4.4.min.js" type="text/javascript" charset="utf-8">
</script>
<script src="jquery.fcbkcomplete.js" type="text/javascript" charset="utf-8">
</script>
</head>
<body id="test">
<h1>FCBKcomplete Demo</h1>
<div id="text">
</div>
<form action="submit.php" method="POST" accept-charset="utf-8">
<select id="select3" name="select3">
<option value="test1">sleep</option>
<option value="test3">sport</option>
<option value="test3">freestyle</option>
</select>
<br/>
<br/>
<input type="submit" value="Send">
</form>
<script type="text/javascript">
$(document).ready(function(){
$("#select3").fcbkcomplete({
json_url: "data.txt",
addontab: true,
height: 2
});
});
</script>
<div id="testme"></div>
</body>
答案 0 :(得分:0)
嗯,这是HTML中的select
标记,而不是input type="text"
。你期望发生什么?