我有一個onclick事件,其中有一個值,我想發佈到後端php腳本。只是不知道如何在對話框中獲取它。如何將onclick變量轉換爲對話框功能
function reorder(job_index)//<--------this fella
{
$('#dialog').dialog('open');
}
$(document).ready(function(){
$(function() {
$("#dialog").dialog({
bgiframe: true,
autoOpen: false,
height: 250,
width: 600,
modal: true,
buttons: {
'Yes, use the number above': function() {
var jobID=$("#jobnumber").val();
$.post("rpc.php", {
job_index:job_index,// <-------to here
jobID:jobID,
method: "reorder"
},
function(data,textstatus)
{
alert(data.message);
}, "json");
},
'No, create a new number for me': function() {
$(this).dialog('close');
},
Cancel: function() {
$(this).dialog('close');
}
}
});
});
});
該值爲job_index。有小費嗎?
感謝
只是一個提示:你有你'外功能ready'裏面嵌套'read'y功能。這是因爲'$(function(){'和'$(document).ready(function(){' – 2009-12-12 11:52:14
)相同好的,謝謝,不知道 – jason 2009-12-12 19:46:26