のような iFrame を作成します。
var iframe = dojo.io.iframe.create(generatedRequestId);
次のような追加の JavaScript 関数を挿入したいと考えています。
関数 printThis() { window.print(); }
親ウィンドウで次のようなコードから printThis() 関数を呼び出すことができるように、iFrame で
_setPrintExportCookieInterval: function(/**String*/requestId, /**function*/closePopup, /**String*/exportTypeId) {
//have the interval autoexpire after some amount of seconds
var count = 0;
var intervalMs = 2000;
var intervalId = self.setInterval(function() {
var reportCookie = dojo.cookie(requestId);
if(reportCookie || count > 300000) { //5 mins
//if there's a status failure, don't close the window
if(reportCookie == "success") {
//console.debug(exportTypeId);
if(exportTypeId == PRINT) {
var iframe = dojo.byId(requestId);
iframe.printThis();
}
closePopup();
} else {
console.debug("print/export request returned with nonstandard status " + reportCookie);
}
window.clearInterval(intervalId);
//delete the cookie
dojo.cookie(requestId, null, {path: "/", expires: -1});
//destroy the iframe
//dojo.destroy(dojo.byId(requestId));
};
count+=intervalMs;
}, intervalMs);
return intervalId;
},
-これは可能ですか?dojo.io.iframe.create(generatedRequestId) は、onLoad で実行されるコードである 2 番目のパラメーターを取ることを知っていますが、iframe の読み込み後に呼び出すことができる関数である必要はありませんか?
アドバイスをありがとう。