這是代碼的一部分。問題是,這行"$("#b_facetNewChild").button().click(function(){"
意味着當點擊按鈕「facetNewChild」時應該觸發以下內容:因爲按鈕上沒有「onClick」功能。另外,你能簡單地解釋一下,將這個嵌套到另一個函數「newChildFacet()」以及如何調用它是什麼意思? 對不起,我是JavaScript新手。謝謝!需要了解javascript函數的調用方式
function newChildFacet()
{
// button click
$("#b_facetNewChild").button().click(function(){
//get selected fId
var $fId=getSfSelectedFIds();
if($fId.length>0 && $fId.split(",").length!=1)
{
messageBox("Tip","Please select <b>ONE</b> as the parent facet. If no facet is selected, the new facet will be created under <b>root</b>.");
return false;
}
//some more stuff here!
});
// newChildFacetDialog
$("#newChildFacetDialog").dialog({
autoOpen: false,
modal: true,
title: "New Child Facet",
buttons: {
"Cancel": function() {
$(this).dialog('close');
},
"Create": function() {
//get data
var $parentId=getSfSelectedFIds();
});
$(this).dialog('close');
}
}
});
}
它的jQuery特定 – mpapis 2010-11-18 10:28:49