2012-07-30 84 views
0

我使用的是fullcalendar: - http://arshaw.com/fullcalendar/完整的日曆+ jQuery UI的對話

,我使用jQuery。員額得到一個參數回到同一頁面,產生了一些成績,這是運作良好。

與此同時,我希望用jQuery UI的對話,以保持顯示的內容。從官方網站粘貼示例代碼時,該示例正常工作。但是,將.post輸出與對話結合使用時,它並不成功。

我想尋求幫助,在結合下面的腳本的2套: - (!工作)//生成。員額輸出

<script> 
function event_details(thevalue){ 
$.post('module/calendar/event_details.php',{ 
eid:thevalue}, 

function(output){ 
    $('#theeventmsg').html(output); 
}); 
} 
</script> 
<div id='theeventmsg'></div> 

// jQuery UI的對話(工作! )

<script> 
// increase the default animation speed to exaggerate the effect 
$.fx.speeds._default = 1000; 
$(function() { 
    $("#dialog").dialog({ 
     autoOpen: true, 
     show: "blind", 
     hide: "explode" 
    }); 

    $("#opener").click(function() { 
     $("#dialog").dialog("open"); 
     return false; 
    }); 
}); 
</script> 



<div class="demo"> 
<div id="dialog" title="Basic dialog"> 
    <p>This is an animated dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> 
</div> 
<button id="opener">Open Dialog</button> 
</div><!-- End demo --> 

可以幫忙嗎?非常感謝!!

+0

@Speransky DANIL,我想用對話來包含來自.POST輸出HTML和彈出... – Ham 2012-07-30 03:10:48

回答

0

嘗試是這樣的:

<script> 
    $.fx.speeds._default = 1000; 

    $(document).ready(function() { 
    $("#dialog").dialog({ autoOpen: false }); 

    $('#button').click(function() { 
     var data = { ... }; 

     $.post('module/calendar/event_details.php', data, function (output) { 
     $('#dialog p').html(output); 
     $("#dialog").dialog("open"); 
     }); 
    }); 
    }); 
</script>  

<div id="dialog"> 
    <p>content</p> 
</div> 

<button id="button">button</button> 

或者:

<script> 
    $(document).ready(function() { 
    function eventdetail(thevalue) { 
     $.post('event_details.php', { eid: thevalue }, function (output) { 
     $('#dialog p').html(output); 
     $("#dialog").dialog({ autoOpen: true }); 
     }); 
    } 

    $('#button').click(function() { eventdetail('value'); }); 
    }); 
</script> 

<div id="dialog"> 
    <p>content</p> 
</div> 

<button id="button">button</button> 
+0

實際,我的朋友可以撥打一個對話框起來使用: - 但我不能! – Ham 2012-07-30 04:02:49