0

jquery.ui.datepickerを使用するhtmlページ(mypage.html)があります

<table>
<tr>
<td valign="middle"><input type="text" name="from_date"  id="from_date" ></td>
<td width="6"><script type="text/javascript">
            $(function() {
                        $("#from_date").datepicker(
                        {dateFormat: 'mm-dd-yy', showOn: 'both', buttonImageOnly: true, changeMonth: true, changeYear: true ,buttonImage: '../images/calender_icons.gif' });
             });
            </script></td>
</tr></table>

ajaxを使用して別のページからこのページをロードする場合、日付ピッカーはロードされません。私のajaxコードは以下のgivnです

$(document).ready(function(){
    $("#MainDiv").click(function(event){
        $.ajax({
            url: 'mypage.html',
            cache: false,
            success: function(html){
                $("#MainDiv").html(html);
                alert('succ');
            },
            complete: function(){
                alert('comp');  
            },
            error : function(){
                alert('err');
            },
            dataType: "html"

        });
    });
 });

どんな助けでもいただければ幸いです。

4

1 に答える 1

0

私は.loadメソッドでそれをやった


$(document).ready(function(){
    $("#MainDiv").クリック(関数(){
        $("#secondDiv").load("test.html");
    });
});


于 2010-09-09T06:12:03.683 に答える