对于var ShopLogicOptions = {},{}的含义是什么;

时间:2012-06-19 19:58:22

标签: javascript object

{}var ShopLogicOptions = {};

的意义

我一直在网上搜索,但搜索起来很难!

是否将ShopLogicOptions声明为对象?

var ShopLogicOptions = {};
ShopLogicOptions.params = {orderId: '" + SS_JS_OrderNo + "', cartItems:[''], subTotal:'',
grandTotal:'', shippingTotal:'', discount:'', discountCode:'', productSku:'',
productName:'', productCategory:''};

另外,如何正确插入我的SS_JS_OrderNo javascript变量?

2 个答案:

答案 0 :(得分:4)

{}表示空Object。在代码中,它意味着让ShopLogicOptions成为一个没有任何内容的对象。

答案 1 :(得分:-1)

德里克有正确的答案。它是JSON(javascript对象表示法)你是对的,很难谷歌。有关JSON语法的更多信息,请查看此参考:http://www.w3schools.com/json/json_syntax.asp