Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [DHTML] Click to Activate Override Wizard

  1. #1
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,475
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default [DHTML] Click to Activate Override Wizard

    1) CODE TITLE: Click to Activate Override Wizard

    2) AUTHOR NAME/NOTES: jscheuer1

    3) DESCRIPTION: A wizard that generates (from a working multimedia object's* HTML code) the code required to override this silly 'click to activate' business in IE, Opera, perhaps others.

    The wizard works in (tested with) IE 6+, FF 1.5.0.11, Opera 9.01, and outputs code that can be used in any browser that supports document.write. It also outputs non-javascript enabled fall back code.

    4) URL TO CODE: http://home.comcast.net/~jscheuer1/s...activate_w.htm



    *Multimedia Objects like:

    • Flash
    • QuickTime
    • Media Player
    • etc.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Nice script John (as usual). I tested it in IE7, FF 2.0.0.2/2.0.0.3 on Windows XP (Home and Pro) and it works fine.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Ha. Nice script.
    But, your page doesn't validate:
    http://validator.w3.org/check?verbos...activate_w.htm
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,475
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by tech_support View Post
    Ha. Nice script.
    But, your page doesn't validate:
    http://validator.w3.org/check?verbos...activate_w.htm
    Those are errors produced because the validator is trying to validate javascript code as HTML code. It is the validator that is in error.

    The actual code is valid.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Oh, ok.
    BTW, I love the "Supreme Commander Coder"
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,475
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by tech_support View Post
    Oh, ok.
    BTW, I love the "Supreme Commander Coder"
    Thanks, and just to make the validator happy, I made the script it barfed on use a hex entity. Usually it barfs on stuff like so:

    Code:
    document.write('<a name="bob">Bob</a>');
    Because it doesn't see the a tag as open (can't have a tags inside a <script> tag), but does see it getting closed. That can be fixed by escaping the /. However, this time it interpreted a regular expression as a close tag, completely erroneous on its part. Easiest fix for that was making the code external, but then I thought about it and found I could substitute \x3c for <.
    Last edited by jscheuer1; 04-29-2007 at 06:11 AM. Reason: Update Info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    Those are errors produced because the validator is trying to validate javascript code as HTML code.
    No, it isn't. If it did, it would complain about:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <title//<body<script type="text/javascript">
    <p id=">
    </>
    but it's perfectly valid. All that the validator is trying to do is find the end of the script element so it looks for anything that matches an end-tag production.

    It is the validator that is in error.
    You should know better than to write things like that.

    The actual code is valid.
    No, it wasn't. Among the minimisation features of SGML (some of which are enabled in HTML) are unclosed end-tags. These are like normal end-tags except the TAGC (>) is omitted. However, an unclosed end-tag must be followed by a STAGO (<) or ETAGO (</). Instead, it was followed by a comma.

    Mike

  8. #8
    Join Date
    Jun 2006
    Posts
    182
    Thanks
    0
    Thanked 14 Times in 14 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    Easiest fix for that was making the code external, but then I thought about it and found I could substitute \x3c for <.
    What about enclosing the script in a CDATA block?

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,475
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It wasn't a tag at all.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by DimX View Post
    What about enclosing the script in a CDATA block?
    The content model for a script element (in HTML) is CDATA, therefore a marked section won't be interpreted as such; "<![CDATA[" and "]]>" are just plain character sequences.

    Quote Originally Posted by jscheuer1 View Post
    It wasn't a tag at all.
    As far as a SGML parser is concerned, it is: it parses like one, therefore it is one. The fact that you didn't intend for it to be an end-tag, and that it isn't an end-tag for an element recognised by HTML is of no consequence.

    Mike

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •