www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > HTML

    HTML Discussion and technical support for building, using and deploying HTML sites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 12-05-2002, 06:46 AM
    marekk marekk is offline
    Registered User
     
    Join Date: Nov 2002
    Posts: 8
    The <OBJECT> tag

    Hi all,
    I hope someone will be able to help we this problem:

    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.

    That means:

    <OBJECT CLASSID="some-class-id" ODEBASE="some-codebase">
    <PARAM name="some-param" value="some-value">

    <!-- If user stop while the ActiveX loading, this part is called -->

    AND HERE I WANT TO CALL JAVASCRIPT FUNCTION, IE:

    <script>load_failed();</script>

    </OBJECT>

    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.

    Does anybody know how to do it ?
    Thanks for any help.

    Marek
    Reply With Quote
      #2  
    Old 12-05-2002, 10:21 AM
    Stefan Stefan is offline
    HTML-Mushroom
     
    Join Date: Nov 2002
    Posts: 984
    Re: The <OBJECT> tag

    Quote:
    Originally posted by marekk
    <!-- If user stop while the ActiveX loading, this part is called -->

    AND HERE I WANT TO CALL JAVASCRIPT FUNCTION, IE:
    This is your problem.
    You can't suddenly switch to the alternate content of an <object> tag.

    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.

    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.

    In short, you have to figure out another method to get the "download canseled" trigger.
    __________________
    // Stefan Huszics
    Reply With Quote
      #3  
    Old 12-05-2002, 07:12 PM
    Stefan Stefan is offline
    HTML-Mushroom
     
    Join Date: Nov 2002
    Posts: 984
    Quote:
    Originally posted by Dave Clark
    Answered and working in the JavaScript forum.

    http://forums.webdeveloper.com/showt...=&threadid=593

    Dave
    Well, partially at least.

    None of
    onError=
    onStop=
    onAbort=

    is actually valid HTML
    http://www.w3.org/TR/html4/interact/....html#h-18.2.3

    But since we are dealing with ActiveX, I guess the original poster isn't too concerned with cross browser compability anyway.
    __________________
    // Stefan Huszics
    Reply With Quote
      #4  
    Old 12-06-2002, 07:39 AM
    Stefan Stefan is offline
    HTML-Mushroom
     
    Join Date: Nov 2002
    Posts: 984
    Quote:
    Originally posted by Dave Clark
    [b]You still have this problem with confusing what is "valid" with what is considered according to "standards":
    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.

    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.
    __________________
    // Stefan Huszics
    Reply With Quote
      #5  
    Old 12-06-2002, 08:38 AM
    Stefan Stefan is offline
    HTML-Mushroom
     
    Join Date: Nov 2002
    Posts: 984
    Quote:
    [i]Originally posted by Dave What would it matter if I told him that that code might not work in any browser except IE?
    Becuse next time he (or someone else reading this forum) wants to use your code example it might not be in combination with ActiveX...

    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.
    __________________
    // Stefan Huszics

    Last edited by Stefan; 12-06-2002 at 08:41 AM.
    Reply With Quote
      #6  
    Old 12-06-2002, 08:54 AM
    gil davis's Avatar
    gil davis gil davis is offline
    Nobody important
     
    Join Date: Nov 2002
    Posts: 4,434
    From the HTML 4.01 W3C RECOMMENDATION:
    Quote:
    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 http://www.w3.org/ for more information).
    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.

    Netscape has supported the following events since JavaScript 1.0 (asterisks indicate included in W3C recommendation):

    onAbort
    onBlur *
    onChange *
    onClick *
    onDblClick *
    onDragDrop
    onError
    onFocus *
    onKeyDown *
    onKeyPress *
    onKeyUp *
    onLoad *
    onMouseDown *
    onMouseMove *
    onMouseOut *
    onMouseOver *
    onMouseUp *
    onMove
    onReset *
    onResize
    onSelect *
    onSubmit *
    onUnload *

    IE supports these and a ton more.

    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).
    Reply With Quote
      #7  
    Old 12-06-2002, 09:49 AM
    Stefan Stefan is offline
    HTML-Mushroom
     
    Join Date: Nov 2002
    Posts: 984
    Quote:
    Originally posted by gil davis

    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.
    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.

    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).

    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.

    http://msdn.microsoft.com/workshop/a...ts/onerror.asp

    eg

    <script>
    ...
    hepp.onerror=
    ...
    </script>

    <object id="hepp"...

    __________________
    // Stefan Huszics

    Last edited by Stefan; 12-06-2002 at 09:56 AM.
    Reply With Quote
      #8  
    Old 12-06-2002, 10:45 AM
    jeffmott's Avatar
    jeffmott jeffmott is offline
    Adrenalin Junkie
     
    Join Date: Nov 2002
    Location: NY, USA
    Posts: 736
    If it works (and it does -- as testified to by the person I helped), then it is valid

    Quote:
    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.
    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.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 08:20 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.