This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes call function through window reference javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "call function through window reference javascript" Watch "call function through window reference javascript" New topic
Author

call function through window reference javascript

ssl vijay
Greenhorn

Joined: Sep 03, 2001
Posts: 4
hai friends,
i have one function ieExecWB. when i call this function window.ieExecWB(6,-1) it will print the current window content fine. but it try with
var a=open("some file(ie.,pdf file)",'winname');
a.ieExecWB(6,-1); javascript error is coming
ie., object does not support this property or method.
please give the necessary advice for print the child window content(which is pdf/text file)
the function is below,
function ieExecWB( intOLEcmd, intOLEparam )
{
// Create OLE Object
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
// Place Object on page
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
// if intOLEparam is not defined, set it
if ( ( ! intOLEparam ) | | ( intOLEparam < -1 ) | | (
intOLEparam > 1 ) )
intOLEparam = 1;
// Execute Object
WebBrowser1.ExecWB( intOLEcmd, intOLEparam );
// Destroy Object
WebBrowser1.outerHTML = "";
}
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: call function through window reference javascript
 
Similar Threads
Print Preview using Javascript doubt
Printing
is print preview possible
ExecWB
ActiveX error in printpreview JS