我开始在 Google Chrome 上测试我的网站
'cannot call method 'join' of null'
执行此操作时出现:
var sChoices = oQuestion.aChoiceRand.join("");
在 IE 和 FF 中运行良好。我尝试使用此代码执行的操作是将所有 aChoiceRand
数组元素连接到一个字符串中,而不使用任何分隔符。我该如何解决这个问题?
最佳答案
问题的原因一定更早,当oQuestion.aChoiceRand
被分配时:你认为它被分配给一个数组(显然IE和FF同意你的观点),Chrome告诉你它是null 。如果没有看到应该为 oQuestion.aChoiceRand
分配其值的代码,我们就无法真正提供帮助......
关于javascript - Google Chrome JavaScript 错误 - 无法调用 null 的方法 'join',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/871926/