0

我的页面中有一些 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 说它在这条线上:

4

1 回答 1

3

在传递给的 json 选项中jqxDropDownList,您有一个密钥margin-top,因为它-必须包含在""

尝试

$("#jqxWidget1").jqxDropDownList({ source: source, selectedIndex: 0, width: '200',"margin-top":'0px', height: '25', theme: theme });
于 2013-08-02T11:52:51.180 回答