J4N*_*J4N 2 javascript jquery jquery-ui autocomplete jquery-autocomplete
对于一个网站,我将在不同的页面上有很多自动完成字段.
它们在所有页面上的工作方式完全相同,但它们不能调用相同的URL.
我想知道是否有可能提到<input>将成为自动填充字段的网址?目标是为许多html代码提供一个js代码
我尝试了一些东西,但它似乎不起作用:Html:
<input type="field" name="search" class="autocomplete" value="Search" url="smalltest/otherTest/..." />
Run Code Online (Sandbox Code Playgroud)
和JS
$(document).ready(function () {
$("input.autocomplete").autocomplete({
source: $(this).attr("url")
}); });
Run Code Online (Sandbox Code Playgroud)
我在jquery lib中遇到异常.
| 归档时间: |
|
| 查看次数: |
259 次 |
| 最近记录: |