2016-08-18 17 views
0

웹 사이트에 문제가 있습니다. jQuery가 작동하지 않습니다.
내 스크립트 전에 <head> 태그에 jQuery를로드합니다.
.htaccess와 웹 서버의 사용 권한과 관련이 있다고 생각합니까? 이 수도 있다면,이 index.php 파일에 다음과 같은 권한이 : 여기내 웹 사이트에서 jQuery를 사용할 수 없습니다.

r-xrwxr-- 574 

은 내 사이트에 대한 링크입니다 : http://hopdog.houa.org

그리고 여기에 문제의 코드입니다 :

<!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> 

그것에 대한 아이디어가 있으십니까?
업데이트 : 사이트가 고정되어 코드가 변경되었습니다.

+0

나에게 아무런 문제가 없습니다. code.jquery.com CDN을 사용하려고하는 것을 보았습니다. 따라서 웹 브라우저 나 네트워크에서 단순히 차단하는 것이 가능합니다. 웹 서버에 jQuery를 추가하고 자체 서버에서 소스를 가져 오십시오. 이 문제는 나에게 너무 자주 나타나서 CDN에 신경 쓰지 않았습니다. – MonkeyZeus

답변

0

body 태그의 끝에 태그를 포함하면 작동하는지 확인하십시오. 이처럼

는 :

<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> 

여전히 작동하지 않는 경우. 어쩌면 다른 jquery 링크를 시도해보십시오. 이 항목을 좋아하는 사람 https://code.jquery.com/jquery-3.1.0.min.js

+0

감사합니다! –

+0

도움이 된 것을 기쁘게 생각합니다! – jamien

관련 문제