这是代码的一部分。问题是,这行"$("#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