【发布时间】:2014-08-19 17:01:16
【问题描述】:
我目前有此代码来检查特定 ID 的网站 URL GET 选项,但每当运行此代码时,我都会收到一个奇怪的错误:Uncaught TypeError: Undefined is not a function
这是我的代码:
<script language="JavaScript">
var familyid = "id=8978566";
var corporateid = "id=8978565";
if(window.location.indexOf(familyid) === -1)
{
document.write("Family ID not found");
}
</script>
如果我能在这个问题上获得一些指导,那就太棒了......我使用 .indexOf() 函数找不到类似的问题
【问题讨论】:
标签: javascript get typeerror indexof location-href