I am using OCX for some functionality, for that I have used the <object> and want to referring the same thru the JavaScript as a global variable. Its give error "'b' is null or not an object"
var b = window.document.getElementById("OCXID");
//var b = document.OCXID; //this also not working fine...
function callOCXmethod(){
b.someOCXMethod();
}
Local variables are Working:
function callOCXmethod(){
var b = window.document.getElementById("OCXID");
//var b = document.OCXID; //this also working fine...
When defining "b", you might be called document.getElementById before the <object> tag is parsed and made a part of the document object model. In the window.onload event, or an inline SCRIPT just below the <object> tag, assign a global variable using the document.getElementById function.
When defining "b", you might be called document.getElementById before the <object> tag is parsed and made a part of the document object model. In the window.onload event, or an inline SCRIPT just below the <object> tag, assign a global variable using the document.getElementById function.
Bookmarks