【发布时间】:2017-04-07 18:53:51
【问题描述】:
这是我的代码。
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";
}
}
GoDaddy 说权限很好。在我的桌面上工作就像一个魅力,他们说我的代码一定有问题。他们说这可能是一种过时的编码方式。
当您按下按钮时没有任何反应,如果您想亲自尝试,请访问 http://spacehelmetstudios.com/tutorials/unity2d/directionalgravity2d/directionalgravity2d.html 并尝试将其从 C# 更改为 JS。
我不会撒谎,我对服务器端的事情不太了解。
有什么想法吗?谢谢。
【问题讨论】:
-
您可以使用浏览器的开发者控制台来更好地了解错误。 (Chrome 中的 Ctrl + Shift + i,IE 中的 f12 等)。 i.thomas.gg/qlP5yml.png
标签: javascript linux server