Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-05-2010, 06:16 PM   PM User | #1
amaze646
New to the CF scene

 
Join Date: Nov 2010
Posts: 7
Thanks: 5
Thanked 0 Times in 0 Posts
amaze646 is an unknown quantity at this point
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..
amaze646 is offline   Reply With Quote
Old 11-05-2010, 06:20 PM   PM User | #2
digitalclubb
New Coder

 
Join Date: Nov 2010
Location: London, UK
Posts: 40
Thanks: 1
Thanked 4 Times in 4 Posts
digitalclubb is an unknown quantity at this point
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?
digitalclubb is offline   Reply With Quote
Users who have thanked digitalclubb for this post:
amaze646 (11-05-2010)
Old 11-05-2010, 06:27 PM   PM User | #3
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,146
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
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.
DrDOS is offline   Reply With Quote
Users who have thanked DrDOS for this post:
amaze646 (11-05-2010)
Old 11-05-2010, 06:34 PM   PM User | #4
digitalclubb
New Coder

 
Join Date: Nov 2010
Location: London, UK
Posts: 40
Thanks: 1
Thanked 4 Times in 4 Posts
digitalclubb is an unknown quantity at this point
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?
digitalclubb is offline   Reply With Quote
Users who have thanked digitalclubb for this post:
amaze646 (11-05-2010)
Old 11-05-2010, 06:57 PM   PM User | #5
amaze646
New to the CF scene

 
Join Date: Nov 2010
Posts: 7
Thanks: 5
Thanked 0 Times in 0 Posts
amaze646 is an unknown quantity at this point
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?
amaze646 is offline   Reply With Quote
Old 11-05-2010, 07:11 PM   PM User | #6
amaze646
New to the CF scene

 
Join Date: Nov 2010
Posts: 7
Thanks: 5
Thanked 0 Times in 0 Posts
amaze646 is an unknown quantity at this point
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!
amaze646 is offline   Reply With Quote
Old 11-06-2010, 01:17 AM   PM User | #7
Apostropartheid
The Apostate


 
Apostropartheid's Avatar
 
Join Date: Oct 2007
Posts: 3,215
Thanks: 16
Thanked 265 Times in 263 Posts
Apostropartheid is on a distinguished road
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.
__________________
Blog | Twitter
Useful links: W3C HTML Validator | W3C CSS Validator | HTML 5 Guide
CF: HTML & CSS Resources/Tutorials Thread | HTML & CSS Posting Rules and Guidelines
Remember: no link, no code, no help!
Apostropartheid is offline   Reply With Quote
Old 11-06-2010, 04:43 AM   PM User | #8
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
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!
teedoff is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:04 AM.


Advertisement
Log in to turn off these ads.