Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JavaScript在设置中启用时无法在chrome上工作_Javascript - Fatal编程技术网

JavaScript在设置中启用时无法在chrome上工作

JavaScript在设置中启用时无法在chrome上工作,javascript,Javascript,此脚本仅在firefox上运行,在chrome中,它给了我一个错误: 未捕获类型错误:无法调用未定义的方法“substring” 函数hidediv() { document.getElementById('divright').style.display='none'; document.getElementById('divleft').style.margin=“0自动”; document.getElementById('divleft').style.cssFloat=“无”; }

此脚本仅在firefox上运行,在chrome中,它给了我一个错误:

未捕获类型错误:无法调用未定义的方法“substring”


函数hidediv()
{
document.getElementById('divright').style.display='none';
document.getElementById('divleft').style.margin=“0自动”;
document.getElementById('divleft').style.cssFloat=“无”;
} 
函数showdiv()
{
document.getElementById('divright').style.display='block';
document.getElementById('divleft').style.cssFloat=“left”;
} 

检查
工具提示。显示
工具提示。隐藏
方法,我猜错误出现在那里,因为您在任何地方都没有使用子字符串方法。

您确定没有其他代码吗?据我所知,您没有调用子字符串。您的
隐藏
显示
功能在哪里?什么是
工具提示
?我这边没有错误,你的问题问得很差,还有一些字符串类型的对象在不应该的地方没有定义。使用chrome的调试功能来缩小错误的来源。