두 개의 jquery 플러그인 파일을 내 응용 프로그램에 추가하려고합니다. 사용자가 내 ajax 이벤트를 트리거하면 서버는 양식 단추로 텍스트를 리턴합니다. 플러그인 (jquery 달력)은 사용자가 반환 된 텍스트 내부의 양식 버튼을 클릭하면 작동합니다. 코드를 작동 시키려면 메인 페이지 대신 리턴 텍스트 안에 링크를 추가해야하지만이 작업을 수행하는 방법을 모르십시오. 나는 자문을 제공하고 전문가의 의견이 필요하다. 감사. 나는 내 질문에 설명 희망반환 된 텍스트에 jquery 링크 추가
$("#addMatch").live('click', function(){
//the code below will create a calendar when a user click the link...I am not sure //where I should add my two jquery plugins link...
$("#returnDiv").html("<td><input type='text' size='6' class='date-pick dp-applied'"+ "name='date'><a style='color:white;' class='dp-choose-date' title='Choose Date'"+ "href='#'>Date</a></td>";
return false;
});
내 주요 페이지 HTML
//required jquery plugins ...didn't work if I add them in the main application.
<script type="text/javascript" src="JS/date.js"></script>
<script type="text/javascript" src="JS/datePicker.js"></script>
<script type="text/javascript" src="JS/selectWeek.js"></script>
<div id="gameInfo">
//return text will be displayed here.
</div>
내 반환 텍스트 ... 그것의 일부 ....
<form>
<div id=returnDiv>
// the form input will be added here when a user clicks #addMatch button...
</div>
<tr>
<td><input type="button" id="addMatch" name="addMatch" value="Add Match"/> </td>
</tr>
</form>
내 JQuery와 잘. +1 답장 ... : D
당신은 형식이 잘못된 html이 있습니다 ... 그리고 우리는 캘린더를 만드는 링크를위한 jQuery를 볼 수 있습니다 .... – Reigel
오직 내 html의 일부만 표시합니다. jquery 플러그인 파일은 매우 길다. 내가 그들을 모두 보여줄 수 있다고 생각하지 마라. – FlyingCat
플러그인에 관심이있는 분은이 플러그인을 사용하고 있습니다 ... http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/ – FlyingCat