Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/408.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在GoDaddy主机上不起作用_Javascript_Linux_Server - Fatal编程技术网

Javascript在GoDaddy主机上不起作用

Javascript在GoDaddy主机上不起作用,javascript,linux,server,Javascript,Linux,Server,这是我的密码 var cSharpButtons = document.getElementsByClassName("csharpbutton"); var jSButtons = document.getElementsByClassName("jsbutton"); var cSharp = document.getElementsByClassName("csharp"); var jS = document.getElementsByClassName("js"); function

这是我的密码

var cSharpButtons = document.getElementsByClassName("csharpbutton");
var jSButtons = document.getElementsByClassName("jsbutton");
var cSharp = document.getElementsByClassName("csharp");
var jS = document.getElementsByClassName("js");

function switchToCSharp() 
{
    for (i = 0; i < cSharpButtons.length; i++) //change button colors
    { 
        cSharpButtons[i].style.backgroundColor = "#00AEEF";
    }
    for (i = 0; i < jSButtons.length; i++) 
    { 
        jSButtons[i].style.backgroundColor = "lightgrey";
    }

    for (i = 0; i < cSharp.length; i++) //change code
    { 
        cSharp[i].style.display = "inline";
    }
    for (i = 0; i < jS.length; i++) 
    { 
        jS[i].style.display = "none";
    }

}

function switchToJS() 
{
    for (i = 0; i < jSButtons.length; i++) //change button colors
    { 
        jSButtons[i].style.backgroundColor = "#00AEEF";
    }
    for (i = 0; i < cSharpButtons.length; i++) 
    { 
        cSharpButtons[i].style.backgroundColor = "lightgrey";
    }

    for (i = 0; i < cSharp.length; i++) //change code
    { 
        cSharp[i].style.display = "none";
    }
    for (i = 0; i < jS.length; i++) 
    { 
        jS[i].style.display = "inline";
    }
}   
var cSharpButtons=document.getElementsByClassName(“csharpbutton”);
var jSButtons=document.getElementsByClassName(“jsbutton”);
var cSharp=document.getElementsByClassName(“cSharp”);
var jS=document.getElementsByClassName(“jS”);
函数switchToCSharp()
{
对于(i=0;i
戈达迪说许可是可以的。他们说我的代码一定出了问题。他们说这可能是一种过时的编码方式

当你按下一个按钮时,什么也不会发生,你可以亲自尝试访问并尝试将它从C#更改为JS

我不会撒谎,我对服务器端的事情不太了解


有什么想法吗?谢谢。

我知道这不是答案,但在开发人员控制台中,我没有看到任何JS文件下载,我收到一个控制台错误,说您的函数没有定义。也许您忘记在
标记中添加JS文件了?

您可以使用浏览器的开发人员控制台更好地了解错误。(Chrome中的Ctrl+Shift+i,IE中的f12等)。返回错误404谢谢,只是再次检查,它在那里,不知道为什么它找不到。你是个天才!是的,但语言中的L是大写的,但它的引用不是。我感到尴尬,下次我会做更多的故障排除,但感谢老兄,我开始感到慌乱。没问题,发生在我们所有人身上,不管我们有多丰富的经验