SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru Todd Temple's Avatar
    Join Date
    Mar 2005
    Location
    Tennessee
    Posts
    797
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How To Validate an iFrame with onload in XHTML

    Can someone share with me how I would validate the link below? The XHTML includes an iframe that has the "onload" attribute which will not validate. Here is the page in question:

    LINK-
    http://www.securehostserver.info/rvf/financing/

    Thanks in advance to anyone who can help!

    Todd
    Todd Temple > T2 Design

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,789
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    onload is JavaScript and so goes in a separate JavaScript file and not in the (X)HTML.

    If it is in JavaScript attached to the page it is to run in then use window.onload = and if it is in some other frame then reference the right frame and use the .onload event handler on it.

    Alternatively for even greater flexibility use an event listener instead.

    The only JavaScript that ever needs to go in the (X)HTML is

    <script type="text/javascript" src="extjsname.js"></script> for HTML

    or

    <script type="application/javascript" src="extjsname.js"/> for XHTML

    where extjsname.js is the name of the file containiing the JavaScript.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Guru Todd Temple's Avatar
    Join Date
    Mar 2005
    Location
    Tennessee
    Posts
    797
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The onload attribute is within the iframe. Do your comments still apply to this scenario?

    Here is the code:
    HTML Code:
    <iframe src="http://www.site.com/cgi/list.exe?dealer=name&amp;price>0&amp;price&lt;10000" name="content" id="content" scrolling="auto" width="940" height="1400" frameborder="0" onload="scroll(0,0)"></iframe>   
    Todd Temple > T2 Design


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
  •