SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    632
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Question Invalid HTML Questions about Embedding Flash Objects

    I tried to validate my website's html code, and I got a collection of errors I don't know why they are there. Starting with this first one, Dreamweaver even has a selection for src in the <embed> tags. It has a lot of problems with this line of code and almost everything in it.

    Code:
    <embed src="pleaseselectapage.swf" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="300" height="30" name="pleaseselectapage" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    the Doctype statement in my file is

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    I also am getting errors about ul and li tags. My HTML menu code looks like this:

    Code:
    <ul>
    		<li id="insurance"><a href="#">insurance</a>
        		<ul>
            		<li><a href="#">property insurance</a>
                		<ul>
                    		<li><a href="#">under construction</a></li>
                    	</ul>
                	</li>
                	<li><a href="#">auto insurance</a>
                		<ul>
                    		<li><a href="#">under construction</a></li>
                    	</ul>
                	</li>
                	<li><a href="#">health insurance</a>
                		<ul>
                    		<li><a href="#">under construction</a></li>
                    	</ul>
                	</li>
                	<li><a href="#">annuities</a>
                		<ul>
                    		<li><a href="#">under construction</a></li>
                    	</ul>
                	</li>
           	   </ul>
       	   </li>
    	</ul>
    The error says "document type does not allow element "ul" here; assuming missing "li" start-tag"

    Thanks for any input from you.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    <embed> is not an official HTML element (though all browsers recognize it) so it will never validate.

    That list you posted validates on its own, so perhaps the context is important?
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    632
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I don't know what you mean by the context of the list.

  4. #4
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    632
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    So if I can't embed a flash object without the code staying valid, does that mean my JavaScript in the head tag will be ignored?

  5. #5
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The <embed> tag isn't valid in XHTML. I found a page that will take the embed code and turn it into valid XHTML (Validifier: Turn Flash embed code into valid XHTML), and this is what it coughed up:

    Code:
    <!--[if !IE]> -->
      <object type="application/x-shockwave-flash" data="pleaseselectapage.swf" width="300" height="30">
    <!-- <![endif]-->
    <!--[if IE]>
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="300" height="30">
        <param name="movie" value="pleaseselectapage.swf" />
    <!--><!-- http://Validifier.com -->
      </object>
    <!-- <![endif]-->

  6. #6
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    632
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What a beneficial post, EarlyOut!

    I do have a question though about this code you published. the <!-- [if IE]> code block is left commented out. Won't this eliminate the code from being recognized even if the user is browsing with Internet Explorer?

  7. #7
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, that's the way conditional comments work - IE sees them, but other browsers ignore them: CSS - Conditional comments

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by etidd View Post
    I don't know what you mean by the context of the list.
    Taken in isolation, the code is ok, but it may not be playing nicely with other code on your page. Most likely, there is a missing closing tag on another element, which makes the validator choke when it sees a <ul> when it expects something else.

    Regarding validation, don't get too caught up in it. Validation is just a guide. It doesn't mean the page won't work. <embed> is supported in all browsers. The validator is just there to alert you to possible problems. But then it's up to you to use your judgment over whether it's really a problem or not. <embed> is not a problem.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  9. #9
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    632
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your post!

    The reason I have been looking at this closely is because I feel the JavaScript inside my <head> tag inside this index.php file is being ignored. Actually, I'm sure it's being ignored. Would it solve the problem to move this script into an external file?

  10. #10
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It shouldn't matter, as long as the Javascript is within proper <script> tags. But we can't see your page, so...

  11. #11
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    632
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    you can try looking at it from productreviewsbytyler.com . That's not this page, an unused domain I have before I buy the one for this site.

  12. #12
    SitePoint Addict EarlyOut's Avatar
    Join Date
    Mar 2011
    Location
    Sector R
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Javascript embedding looks OK to me, though I can't tell what it's supposed to be doing.

    On the nested lists, you can't embed a <ul> in another <ul>. It has to be embedded in an <li>. For example:

    Code:
    <ul type="square">
        <li>Main Unordered Bulleted List item 1</li>
        <li>Below is an example of HTML nested unordered list with bullets
            <ul type="disc">
                <li>nested list item 1</li>
                <li>nested list item 2</li>
                <li>Sub nested unordered list
                    <ul type="circle">
                        <li>sub nested list item 1</li>
                        <li>sub nested list item 2</li>
                    </ul>
                </li>
            </ul>
        </li>
    </ul>

  13. #13
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    632
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your AWESOME response.


Tags for this Thread

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
  •