我想用Jquery加載兩個模態對話框。他們都使用ajax加載單獨的頁面。唯一的問題是隻有其中一個工作。簡化Jquery代碼幫助!
我想我需要簡化我的代碼,但我不確定如何。
<script type="text/javascript">
$(document).ready(function(){
var dialogOpts = {
modal: true,
bgiframe: true,
autoOpen: false,
height: 400,
width: 550,
draggable: true,
resizeable: true,
title: "Your campaign rates",
};
$("#ratesbox").dialog(dialogOpts); //end dialog
$('#ratesbutton').click(
function() {
$("#ratesbox").load("rate_sheet/index.php", [], function(){
$("#ratesbox").dialog("open");
}
);
return false;
}
);
});
</script>
<script type="text/javascript">
$(document).ready(function(){
var dialogOptsPass = {
modal: true,
bgiframe: true,
autoOpen: false,
height: 400,
width: 550,
draggable: true,
resizeable: true,
title: "Change your pasword",
};
$("#passwordbox").dialog(dialogOptsPass); //end dialog
$('#passwordbutton').click(
function() {
$("#passwordbox").load("change_password/index.php", [], function(){
$("#passwordbox").dialog("open");
}
);
return false;
}
);
});
</script>
它是更多鈔票兩個腳本合併????
你試過了嗎? – vladv 2010-05-31 12:12:35
我很好奇以誰的形式提問這個問題 – jAndy 2010-05-31 12:14:28
@jAndy:我們可以稱它爲投票限制嗎? – 2010-05-31 12:26:14