我无法正常工作,你可以看到下面的代码,看起来它只适用于一个链接,它只会加载index.php?act = old ...
$(document).ready(function(){
$("#example").dialog({modal: true});
$("#example").dialog({width: 500});
$('#newProject').click(function(){
$('#dialogContent').load('index.php?act=new');
});
$('#oldProject').click(function(){
$('#dialogContent').load('index.php?act=old');
});
});
和HTML
<div id="example" title="Create new project or open old project?" style="display:none">
<div id="dialogContent">
Would you like to create a new calculation or open and edit and old calculation?<br /><br />
<a href="#" id="oldProject">Open Old Calculation</a><br /><br /><a href="#" id="newProject">Create New Calculation</a>
</div>
</div>
答案 0 :(得分:1)
尝试禁用链接的默认行为:
$('#newProject').click(function(event)
{
event.preventDefault();
$('#dialogContent').load('index.php?act=new');
});
$('#oldProject').click(function(event)
{
event.preventDefault();
$('#dialogContent').load('index.php?act=old');
});