FormAPI for Teamsite を使用して xml ノードをループし、ノードの 1 つから値を削除する Javascript を作成しました。removeID 関数は、アラートが含まれている場合にのみ正しく機能します。アクションをさまざまな関数に分けて setTimeout() を配置しようとしましたが、何も機能しません。スクリプトは、ページが保存されて閉じられているときにのみ実行されるため、ページは間違いなく既に読み込まれています。他にアイデアはありますか?
これは機能します:
function removeID(xPath) {
if(xPath.getChildByName('path') != undefined && xPath.getChildByName('id') != undefined){
if(xPath.getChildByName('path').getValue() == "" && xPath.getChildByName('id').getValue() != ""){
xPath.getChildByName('id').setValue('');
alert("replaced ");
}
}
return true;
}
これは機能しません (アラートなし):
function removeID(xPath) {
if(xPath.getChildByName('path') != undefined && xPath.getChildByName('id') != undefined){
if(xPath.getChildByName('path').getValue() == "" && xPath.getChildByName('id').getValue() != ""){
xPath.getChildByName('id').setValue('');
}
}
return true;
}