나는 index.php이라는 페이지가 있습니다.이 페이지는 index_work라는 id를 가진 메뉴와 div 일뿐입니다. 메뉴의 항목을 클릭하면 load 메서드를 사용하여 relatorios.php이라는 두 번째 페이지를로드합니다.페이지가 jquery load 메서드에 의해 호출 될 때
페이지 relatorios.php은 jquery datepicker라는 플러그인을 사용합니다.
의 index.php : 여기에 두 페이지에서 일부 코드가
<ul class="sidebar-nav">
<li class="sidebar-brand">
<a href="#"> Menu Title </a>
</li>
<li>
<a href="#" id="linkInformativos">Informativos</a>
</li>
<li>
<a href="#" id="linkRelatorios"> Relatórios </a>
</li>
</ul>
<div id="index_work"></div>
<script type="text/javascript">
$("#linkRelatorios").click(function(){
$("#index_work").load("relatorios.php");
});
</script>
relatorios.php :
<!-- jqueryui datepicker -->
<link rel="stylesheet" type="text/css" href="../plugin/jquery-ui/datepicker.min.css">
<script type="text/javascript" src="../plugin/jquery-ui/datepicker.min.js"></script>
<input type="text" id="dataAtendimentos" >
<script type="text/javascript">
$("#dataAtendimentos").datepicker();
//some other JavaScript that always work
</script>
내가 브라우저에 가서 전체 주소를 입력하면 "로컬 호스트/myproject라는/relatorios.php 모든 모든 시간을 작동합니다.
내가 index.php에로 이동 m을 클릭하면 enu로드 relatorios.php 플러그인 datepicker는 메뉴를 처음 클릭 할 때만 작동합니다. 나머지 시간은 datepicker 대신 입력으로 작동합니다.
- 이 relatorios.php가로드되고 모든
- 클릭에 잘 작동 메뉴 항목 linkRelatorios (여기 페이지에
- 클릭을 index.php로 이동합니다
그래서 이러한 단계입니다 메뉴 항목 linkInformativos (다른 페이지가 div에로드되어 잘 작동 함)
- 메뉴 항목 linkRelatorios를 다시 클릭하십시오 (페이지 relatorios.php이로드 됨). g datepicker 플러그인 제외)
내가 뭘 잘못하고 있니?
여전히 작동하지 않았지만 이미 시도했지만 문제가된다면 메뉴 항목을 처음 클릭 할 때 작동하지 않는다고 생각했습니다. 그것은 또한 페이지에 직접 갈 경우 작동하지 않을 수도 있지만, 감사합니다 :) –