The <OBJECT> tag

liunx

Guest
Hi all,<br />
I hope someone will be able to help we this problem:<br />
<br />
Basically, what I want to do is to call a javascript function in the <OBJECT> tag, when the ActiveX content of this tag failed to load.<br />
<br />
That means:<br />
<br />
<OBJECT CLASSID="some-class-id" ODEBASE="some-codebase"><br />
<PARAM name="some-param" value="some-value"><br />
<br />
<!-- If user stop while the ActiveX loading, this part is called --><br />
<br />
AND HERE I WANT TO CALL JAVASCRIPT FUNCTION, IE: <br />
<br />
<script>load_failed();</script> <br />
<br />
</OBJECT><br />
<br />
But it looks like, tha javascript is not working inside of the object tag. I want this javascript function to be called automatically, without any user input.<br />
<br />
Does anybody know how to do it ?<br />
Thanks for any help.<br />
<br />
Marek<!--content-->Originally posted by marekk <br />
<!-- If user stop while the ActiveX loading, this part is called --><br />
<br />
AND HERE I WANT TO CALL JAVASCRIPT FUNCTION, IE: <br />
<br />
<br />
This is your problem.<br />
You can't suddenly switch to the alternate content of an <object> tag.<br />
<br />
The alternate content is only supposed to come in effect if the main content (in this case your ActiveX) is not understood by the browser.<br />
<br />
In your case you are already in a state where the main content is accepted by the browser and the external resource have begun to Download <!--more-->.<br />
<br />
In short, you have to figure out another method to get the "Download <!--more--> canseled" trigger.<!--content-->Originally posted by Dave Clark <br />
Answered and working in the JavaScript forum.<br />
<br />
<!-- m --><a class="postlink" href="http://forums.webdeveloper.com/showthread.php?s=&threadid=593">http://forums.webdeveloper.com/showthre ... readid=593</a><!-- m --><br />
<br />
Dave <br />
<br />
Well, partially at least.<br />
<br />
None of <br />
onError=<br />
onStop=<br />
onAbort=<br />
<br />
is actually valid HTML<br />
<!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/interact/scripts.html#h-18.2.3">http://www.w3.org/TR/html4/interact/scr ... l#h-18.2.3</a><!-- m --><br />
<br />
But since we are dealing with ActiveX, I guess the original poster isn't too concerned with cross browser compability anyway.<!--content-->Originally posted by Dave Clark <br />
You still have this problem with confusing what is "valid" with what is considered according to "standards":<br />
<br />
<br />
No the problem is that you don't understand that if it's not in the SPEC it's not HTML, becuse the "standards" defines what is HTML.<br />
<br />
The problem isn't that you offer people help and provide them with invalid code that works in some browsers, the problem is that you don TELL people that your solution consists of proprietary code.<!--content-->Originally posted by Dave What would it matter if I told him that that code might not work in any browser except IE? :p <br />
<br />
<br />
Becuse next time he (or someone else reading this forum) wants to use your code example it might not be in combination with ActiveX...<br />
<br />
You never know where your code will end up, thus pointing out the flaws in it might save the person trying to use it a lot of headache.<!--content-->From the HTML 4.01 W3C RECOMMENDATION:<br />
Note. Authors of HTML documents are advised that changes are likely to occur in the realm of intrinsic events (e.g., how scripts are bound to events). Research in this realm is carried on by members of the W3C Document Object Model Working Group (see the W3C Web Site at <!-- m --><a class="postlink" href="http://www.w3.org/">http://www.w3.org/</a><!-- m --> for more information).<br />
<br />
Just because their committee cannot decide to recommend an event handler (even one that has been in use for years, like "onError") does not constitute using it a sin.<br />
<br />
Netscape has supported the following events since JavaScript 1.0 (asterisks indicate included in W3C recommendation):<br />
<br />
onAbort<br />
onBlur *<br />
onChange *<br />
onClick *<br />
onDblClick *<br />
onDragDrop<br />
onError<br />
onFocus *<br />
onKeyDown *<br />
onKeyPress *<br />
onKeyUp *<br />
onLoad *<br />
onMouseDown *<br />
onMouseMove *<br />
onMouseOut *<br />
onMouseOver *<br />
onMouseUp *<br />
onMove<br />
onReset *<br />
onResize<br />
onSelect *<br />
onSubmit *<br />
onUnload *<br />
<br />
IE supports these and a ton more. <br />
<br />
A lot of the ones that W3C does not include in their recommendation have to do with window objects. In fact, they do not enter the window object realm at all. They are only interested in the document (and perhaps rightly so).<!--content-->Originally posted by gil davis <br />
<br />
Just because their committee cannot decide to recommend an event handler (even one that has been in use for years, like "onError") does not constitute using it a sin.<br />
<br />
<br />
There is nothing preventing you from using event handlers that is not in the HTML spec... but DONT't put them in the HTML... keep them in the javascript where they belong.<br />
<br />
The point here is that there is a right way to do it (that will give you valid code) and a wrong way (generally prefered by clark).<br />
<br />
Even the very MS documentation page he links to shows how to add eg onerror the right way, he just likes to break the specs for the hell of it.<br />
<br />
<!-- m --><a class="postlink" href="http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onerror.asp">http://msdn.microsoft.com/workshop/auth ... nerror.asp</a><!-- m --><br />
<br />
eg<br />
<br />
<script><br />
...<br />
hepp.onerror=<br />
...<br />
</script><br />
<br />
<object id="hepp"...<!--content-->If it works (and it does -- as testified to by the person I helped), then it is valid<br />
<br />
Many authors rely on a limited set of browsers to check on the documents they produce, assuming that if the browsers can render their documents they are valid. Unfortunately, this is a very ineffective means of verifying a document's validity precisely because browsers are designed to cope with invalid documents by rendering them as well as they can to avoid frustrating users.<br />
<br />
In other words, you're saying your code is valid because it works in a program whose first assumption is that you don't know what you're doing.<!--content-->
 
Back
Top