我的页面中有一些 jQuery 不断给出错误:
SyntaxError: missing : after property id
代码
<div id='content1' >
<script type="text/javascript">
$(document).ready(function () {
var theme = getDemoTheme();
var source = [
"Suppliers",
"Global Networks",
"Supplier Networks",
"Supplier Prices",
"Supplier Data Import",
"Supplier Target Price Export"
];
// Create a jqxDropDownList
$("#jqxWidget1").jqxDropDownList({ source: source, selectedIndex: 0, width: '200',margin-top:'0px', height: '25', theme: theme });
});
</script>
<div id='jqxWidget1'>
</div>
Firebug 说它在这一行:
最佳答案
在传递给 jqxDropDownList
的 json 选项中,您有一个键 margin-top
,因为它有一个 -
它必须被包装在 ""
尝试
$("#jqxWidget1").jqxDropDownList({ source: source, selectedIndex: 0, width: '200',"margin-top":'0px', height: '25', theme: theme });
关于javascript - jQuery ) 语法错误 : missing : after property id),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18016214/