2012-07-30 88 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