これはコードの一部です。問題は、この行"$("#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 specific – mpapis