doremifasodo0008008 2016-08-18 18:08
浏览 58
已采纳

jQuery无法在我的网站上启用[关闭]

I have a problem with my website: jQuery is not working.
I load jQuery in the <head> tag before my script.
Do you think it has to do with .htaccess and permissions on the Web server? If it may, I have the following permissions on the index.php file:

r-xrwxr-- 574

Here is a link to my site: http://hopdog.houa.org

And here is the code in question:

<!DOCTYPE html> 
<html> 
<head> 
<title>HopDog</title> 
<meta charset ="utf-8" /> 
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.slim.min.js" > 

</script> 
<script> 
alert("$"); 
var menuState = "closed"; 
$("#ssl-seal-secure").click(function() { 
       alert("(это для украшения, ясно?)"); 
}); 
$("#shopB").attr("disabled", "true"); 
$("#shop").hide(); 
$("#login").hide(); 
$("#header1").hide(); 
$("#header2").hide(); 
$("#shopB").click(function() { 
      window.location.href("hopdog.houa.org/shop.php"); 
}); 
$("#header3").hide(); 
$("#header4").hide(); 
$("#mainB").hide(); 
                 $("#shopB").hide(); 
                 $("#myButton").hide(); 
$("#hm").click( function() { 
                 if(menuState.indexOf("closed") == 0) { 
                 $("#header1").show(); 
                 $("#header").hide(); 
                 $("#buyG").hide(); 
                 $("#mainB").show(); 
                 $("#shopB").show(); 
                 $("#myButton").show(); 
                 $("#mainB").click(function() { 
location.reload(true); 
}); 
                 $("#myButton").click(function() { 
menuState="turtleLoginState"; 
$("#header3").show(); 
$("#header1").hide(); 
  $("#mainB").hide(); 
                 $("#shopB").hide(); 
                 $("#myButton").hide(); 
$("#login").show(); 
});  
                 menuState = "opened" 
                 } else { 
                     if(menuState.indexOf("turtleLoginState") == 0) { 
                  $("#header1").show(); 
                 $("#header3").hide(); 
                 $("#login").hide(); 
                 $("#buyG").hide(); 
                 $("#mainB").show(); 
                 $("#shopB").show(); 
                 $("#myButton").show(); 
}else{ 
                 menuState = "closed"; 
                 $("#header").show(); 
                 $("#buyG").show(); 
                 $("#header1").hide(); 
                 $("#mainB").hide(); 
                 $("#shopB").hide(); 
                 $("#myButton").hide(); 
} 
} 
}); 
</script> 
<body> 

  <button id="hm"> 
<img src="https://cdn0.iconfinder.com/data/icons/ui-icon-part-3/128/menu_hamburger-16.png" style="vertical-align:middle" /> 

</button> <p>HopDog оффициальный сайт</p> 
<div id="body"> 
<p id="header">Главная </p> 
<p id="header1">Меню сайта</p> 
<p id="header2">Магазин</p> 
<p id="header3">Вход</p> 
<p id="header4">Мой аккаунт</p> 
<hr size="2" /> 
<div id="body0"> 
<article> 
<div id="shop"> 
<p>under construction.. Sorry for that...</p> 
</div> 
<div id="login"> 
<input id="loginF" size="15" type="email" value="Имя пользователя" /> 
</br> 
<input id="password" type="password" /> 
<input id="submit" type="submit" /> <button id="reg" > <img src="https://cdn4.iconfinder.com/data/icons/business-and-office-2-6/65/55-16.png" />Зарегестрироваться</button> 
</div> 
<marquee id="buyG" behavior="alternete" direction="left" bgcolor="#ffffff">Сделайте предзаказ на Old House Story Сейчас!И получите бонусы на ваш счёт!! <span style="color:#006299;">[кликните чтоб попасть В магазин]</span></marquee> 
<input id="mainB" value="Главная" type="button" /> 
<input id="shopB" value="Магазин" type="button" /> 
<input id="myButton" value="Мой Аккаунт" type="button" /> 
</div> 
</article> 
</div> 
<img id="ssl-seal-secure" src="http://i80.fastpic.ru/thumb/2016/0815/fc/b4c2678de2ab9b4d1260420ddbc1e1fc.jpeg" alt="pseudo-secured by SSL.com (click for more info)" /> 
</body> 
</html>

Any ideas about it?
Update: site fixed, so code changed.

  • 写回答

1条回答 默认 最新

  • douxiajia6104 2016-08-18 18:20
    关注

    See if it would work if you include it at the end of body tag.

    Like this:

    <body>
        <h1>Your elements</h1>
    
        <!-- Scripts -->
        <script src="https://code.jquery.com/jquery-3.1.0.slim.min.js"></script>
        <script>Put your script here.</script>
    </body>
    

    If it still doesn't work. Maybe try different jquery links. Like this one https://code.jquery.com/jquery-3.1.0.min.js

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab有关常微分方程的问题求解决
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable