我有三个对话框,点击按钮即可打开...
我已经链接了jquery-ui和jquery.min.js文件以及jquery-ui.css文件......
但是当我点击按钮时,它会重定向到索引页面,而不是打开对话框....
这是我的jQuery代码......
$(function(){
$("#recipientDialogue").dialog({
autoOpen:false,
});
$("#exclusionDialogue").dialog({
autoOpen:false,
});
$("#suppressionDialogue").dialog({
autoOpen:false,
});
$("openRecipient").click(function(){
$("#recipientDialogue").dialog("open");
});
});
这是我的HTML代码......
<td colspan="3"><button id="openRecipient">Choose Recipients</div></td>
<td colspan="3"><button id="openSuppression">Choose Recipients</button></td>
<td colspan="3"><button id="openExclusion">Choose Recipients</button></td>
<div id="recipientDialogue">
<td colspan="3" style="padding-left: 55px;">
<div id="recipientCheck"></div>
</td>
</div>
<div id="suppressionDialogue">
<td colspan="3" style="padding-left: 55px;">
<div id="suppressionCheck"></div>
</td>
</div>
<div id="exclusionDialogue">
<td colspan="3" style="padding-left: 55px;">
<div id="exclusionCheck"></div>
</td>
</div>
这是用于填充静态json数组复选框的jquery代码...
for(var i=0; i< encoded_recipient_array.length;i++){
jQuery('<input/>', {type:'checkbox',
value: encoded_recipient_array[i].id,
name:'recipient_array[]'
}).appendTo('#recipientCheck'); //append checkbox only with id as its value....
jQuery('<p>',{'text':encoded_recipient_array[i].name
}).appendTo('#recipientCheck'); //append label of checkbox ......
jQuery('<br/>').appendTo('#recipientCheck'); //looks better you know...
}
任何帮助?
答案 0 :(得分:2)
您错过了#
以放在 openRecipient 按钮
$("#openRecipient").click(function(){
$("#recipientDialogue").dialog("open");
});