我有一个 Wordpress 3.9.1,并在我的 WP 页面中添加了 complete.ly 脚本,因此有一个自动完成字段,但它不显示下拉列表,甚至无法编辑。下面的代码列表适用于纯 html,但不适用于 WordPress。我错在哪里以及如何做对?
<div id="filwrap" style='border-bottom:1px solid #333;margin:20px auto;width:500px;'>
</div>
<script src='http://lorenzoongithub.github.io/completely/complete.ly.1.0.1.min.js'></script>
<script>
var c = completely(document.getElementById('filwrap'),
{fontFamily:'sans-serif', fontSize:'26px', promptInnerHTML : '>' });
c.input;
c.hideDropDown();
var availablePDF = [
"1", "2", "3", "4", "5", "6", "7", "8", "9",
"RAL7-520.48-BLK.23(54.2.3.141.0.48)",
"RAL7-520.48-BLK.23(54.2.3.141.0.49)"
];
c.options = availablePDF;
c.hideDropDown();
c.onChange = function(fil){ c.startFrom = fil.indexOf(',')+1; c.repaint(); };
setTimeout(function() { c.input.focus(); c.repaint(); }, 0);
</script>