我得到一个JavaScript(prototype.js中)错误:意外的令牌在这行代码非法的:意外标记非法JavaScript错误
newFriend = new friend(
response[0][email protected][0]._id,
response[0][email protected][0]._nickName,
response[0][email protected][0]._profilePicture,
response[0][email protected][0]._tagLine,
response[0][email protected][0]._isInvite,
response[0][email protected][0]._confirm
);
响应对象看起来是这样的:
[{"@type":"[Lcom.photoviewer.common.model.ThinUser;","@items":[{"_id":"000.060318.05022007.00263.0067ur","_nickName":"siraj","_country":null,"_currentStorageLimit":5000000000,"_currentStorage":0,"_currentFileCount":0,"_profilePicture":null,"_tagLine":null,"_membershipLevel":0,"_isRejected":false,"_isInvite":false,"_confirm":false,"_verifiedOn":1170716666000}]}]
这只发生在Google Chrome浏览器和其他可能的webkit浏览器中。它在Firefox中正常工作。
哇,我很惊讶它可以在任何地方工作! JS标识符中绝对不允许使用“@”(根据ECMA-262-3等)。 – bobince 2010-01-28 21:22:24