Bob*_*Bob 2 javascript internet-explorer custom-object
我是新手在JavaScript中创建自定义对象,所以它可以很简单.
我有这些对象:
function jsonObj(_id,_title,_class,_icon)
{
this.attr = new jsonAttrObj(_id,_title,_class);
this.data = new jsonDataObj(_title,_icon);
this.children = new Array();
};
function jsonAttrObj(_id, _title, _class)
{
this.id = _id;
this.title = _title;
this.class = _class;
};
function jsonDataObj(_title, _icon)
{
this.title = _title;
this.icon = _icon;
};
Run Code Online (Sandbox Code Playgroud)
我把它称为var jsonObject = new jsonObj(id,title,class,icon);
所有字符串变量.
它们在Chrome和Firefox中运行良好,但不适用于IE(8).IE有错误 - 预期标识符.
归档时间: |
|
查看次数: |
759 次 |
最近记录: |