2014-07-16 3 views
0

xampp을 사용하면 작동 할 jquery 스크립트를 얻을 수 없습니다 (모달 상자 생성). 그러나 html (즉, localhost 대신 htdocs 폴더에있는 파일로 이동)을 실행하면 제대로 작동합니다. 누구나 왜 또는 어떻게 작동시킬 수 있습니까?jamery가 xampp과 함께 작동하지 않습니다.

이 코드는 localhost로 이동하지 않으면 FINE으로 작동하므로 xampp을 사용하여 다른 작업을해야하는지 잘 모르겠습니다. 내가 시도하고 jquery 파일에 로컬 파일 경로를 사용하고 로컬 호스트를 통해 연결을 시도, 그래서 그게 문제가 아니에요.

<!DOCTYPE html> 
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> 
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]--> 
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]--> 
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]--> 
<head> 
    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
    <title>Login Form</title> 
    <link rel="stylesheet" href="css/style.css"> 
    <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> 

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script> 
<script src="https://localhost/avesi/jquery.paulund_modal_box.js"></script> 

</head> 
<body> 
    <section class="container"> 
    <div class="login"> 
     <h1>Login to Web App</h1> 
     <form method="post" action="checklogin.php"> 
     <p><input type="text" name="login" value="" placeholder="Username or Email"></p> 
     <p><input type="password" name="password" value="" placeholder="Password"></p> 
     <class="submit"><input type="submit" name="Login" value="Login"> 
     </form> 
    </div> 
    <a href="#" class="paulund_modal">Click Here</a> 


<button type = "button" id="dialog">Click Me!</button> 

<script> 
$(document).ready(function(){ 
    $('.paulund_modal').paulund_modal_box(); 
}); 
</script> 
</body> 
</html> 

참고 : Jquery는 광산이 아니며, 모달 작업을 전혀 시도하지 않았습니다.

+0

첫째 :은'SRC를 변경 = "https : //로 로컬 호스트/avesi /'... "를 src ="/ avesi/... " 으로 변경하고 localhost에서 jquery를로드하고 사용자 정의 스크립트 앞에 문서의 끝에 – eapo

+0

nvm/avesi /로 작동합니다. .. 당신이 스크립트의 앞에 문서의 끝에 무슨 뜻인지 모르겠습니까? – user1114503

+0

디버그 콘솔의 출력? – eapo

답변

0

다운로드 jQuery를이

<script src="/js/jquery.min.js"></script> 
<script src="/avesi/jquery.paulund_modal_box.js"></script> 
+0

그게 전부입니다! Google과 같은 방식으로 링크가 작동하지 않는 이유는 무엇입니까? – user1114503

+0

https://stackoverflow.com/questions/904046/absolute-urls-relative-urls-and – eapo

0

예는 이것이 당신의 xamp에 문제가있을 것

를 해결할 수이 라인을

<script src="https://localhost/avesi/jquery.paulund_modal_box.js"></script> 

희망을 제거합니다. 귀하의 xamp는 오프라인 상태가됩니다. 다음 코드를 변경 /js/jquery.min.js :로 루트/JS 폴더에

+0

그냥 src를 제거하고 실제로 모든 코딩을 수행하는 것을 의미한다면 html doc, 나는 똑같은 결과로 그렇게했다. 작품은 여전히 ​​그 파일을 두 번 클릭하면 localhost를 통과하지만 작동하지 않습니다. – user1114503

+0

브라우저에 다음과 같이 입력하십시오 : https : //localhost/avesi/jquery.paulund_modal_box.js 파일을 열면 다른 좋은 방법이 있습니다. 주어진 URL에 문제가 있거나 xamp가 성공적으로 실행되지 않습니다. –

관련 문제