我得到一個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