根据此处的文档:http://archive.plugins.jquery.com/project/query-object
为了自定义 $.query
的参数,您需要:(引用)
There are now some customizations which can be done, mostly dealing with parsing and with toString generation. The options are set by creating jQuery.query as an object of settings before including the jQuery.query source code on your page as seen below:
所以我正在尝试这个例子:
<script type="text/javascript">
var jQuery.query = { numbers: false, hash: true };
</script>
<script type="text/javascript" src="jquery.query.js"></script>
这就是我得到的:
missing ; before statement
[Break On This Error]
var jQuery.query = { numbers: false, hash: true };
最佳答案
你不能定义这样的变量。不要使用 var
向已存在的变量或对象添加属性。
使用这个
jQuery.query = { numbers: false, hash: true };
关于jQuery 查询字符串对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9168008/