Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts

    end tag for "ul" which is not finished

    I know! There is no li tags in my list so I get this error. But here is the thing. I have horisontal quick gallery on my site. It is a jquery plugin named jCarusel. This code fills images in li tags. So, this all work perfectly fine but I can't validate my page becouse it sais that ul is not finished. When I check source code of my page I only see:

    Code:
    <ul id="mycarousel" class="jcarousel-skin-moja">
    
    			
    </ul>
    If I check with firebug than I can see that li elements are there. I tryed to add one li tag before I call function to generate images, but then no images shows. How can I add li tag so that the browser, validator will see li inside ul. As I said, if I add li in ul before I call function for pictures, I get no results.

    This is plugin that I use. I can see that the same error occures when I validate this page.
    http://sorgalla.com/projects/jcarous..._ajax_php.html


    Thank you

    PHP Code:
    <div id="quickGallery">
        <ul id="mycarousel" class="jcarousel-skin-moja">
            <?php
                    
    //Preverimo ali je morda prikazana galerija. Ce je prikazana galerija, potem odstranimo hitro galerijo.
                    
    function wt_get_ID_by_page_name($page_name)
                    {
                        global 
    $wpdb;
                        
    $page_name_id $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '".$page_name."'");
                        return 
    $page_name_id;
                    }
                    
                     global 
    $post;
                     
    $id $post->ID;
                     
    $id_gallery wt_get_ID_by_page_name('Galerije'); 
                     
    trim($id_gallery);
                     if(
    $id != $id_gallery)
                     {
                        
    // content of picture slider goes here                            
                     
    }
                  
    ?>
                
        </ul>
    </div>
    Last edited by amaze646; 11-05-2010 at 06:20 PM.

  • #2
    New Coder
    Join Date
    Nov 2010
    Location
    London, UK
    Posts
    40
    Thanks
    1
    Thanked 4 Times in 4 Posts
    So are you generating the list items via php? If so why not generate the UL container also inside the php before the list items are embed.

    That way your browser will just see the empty div on the document load.

    If its the carousel thats creating the list items, can't you modify it to specify the containing div and not the UL?

  • Users who have thanked digitalclubb for this post:

    amaze646 (11-05-2010)

  • #3
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,903
    Thanks
    15
    Thanked 226 Times in 226 Posts
    After the page has loaded in Firefox right click the body of the page and choose 'select all', right click again, choose 'view selected source', then right click the source code and choose 'select all' again, then 'copy', and paste that code into the Validator text field, you will need to paste the Doctype statement at the top of the Validator field too, as it gets removed in the first process. It's tedious but it will allow you to fully validate a page written by javascript.

  • Users who have thanked DrDOS for this post:

    amaze646 (11-05-2010)

  • #4
    New Coder
    Join Date
    Nov 2010
    Location
    London, UK
    Posts
    40
    Thanks
    1
    Thanked 4 Times in 4 Posts
    But viewing the generated source contains the list items required to clear out the error you have specified..

    Your problem seems that you are embedding the UL then using the carousel plug-in.

    Set the carousel on the Div and this will embed the UL and LI needed and not contain any validation errors?

  • Users who have thanked digitalclubb for this post:

    amaze646 (11-05-2010)

  • #5
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts
    No, this php code is just checking which page is displayed and if a gallery page is displayed then quick gallery is not shown. Pictures are generated via javascript. Here you can see what I mean. If you click on Galerija than you will notice that image slider is not shown.
    Quote Originally Posted by digitalclubb View Post
    So are you generating the list items via php? If so why not generate the UL container also inside the php before the list items are embed.

    That way your browser will just see the empty div on the document load.

    If its the carousel thats creating the list items, can't you modify it to specify the containing div and not the UL?

  • #6
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    7
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Ok guys, thank you all. I fixed the problem. I replaced all ul and li tags with div and assign the same class to divs. So now there is no more error.

    Best regards!

  • #7
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Quote Originally Posted by amaze646 View Post
    Ok guys, thank you all. I fixed the problem. I replaced all ul and li tags with div and assign the same class to divs. So now there is no more error.

    Best regards!
    For future reference, the reason the error occured was because UL elements must contain at least one child.

  • #8
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Quote Originally Posted by Apostropartheid View Post
    For future reference, the reason the error occured was because UL elements must contain at least one child.
    This was brought up in another post of the OP.

    Glad you got it working!


  •  

    Posting Permissions

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