id, Img Loader et norme W3C
Bonjour,
J'essaie de modifier un petit script qui affiche et pagine une série de news, mais j'ai des erreur lors de la validation W3C.
Voici le script :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| <script type="text/javascript">
$(document).ready(function(){
//Display Loading Image
function Display_Load()
{
$("#loadingnews").fadeIn(900,0);
$("#loadingnews").html("<img src='/home/ajax-loader.gif' alt='loader' />");
}
//Hide Loading Image
function Hide_Load()
{
$("#loadingnews").fadeOut('slow');
};
//Default Starting Page Results
$("#paginationnews li:first").css({'color' : '#EB4C07'}).css({'border' : 'none'});
Display_Load();
$("#contentnews").load("/scripts/pagination_data.php?page=1", Hide_Load());
//Pagination Click
$("#paginationnews li").click(function(){
Display_Load();
//CSS Styles
$("#paginationnews li")
.css({'border' : 'none'})
.css({'color' : '#A0A0A0'});
$(this)
.css({'color' : '#EB4C07'})
.css({'border' : 'none'});
//Loading Data
var pageNum = this.id;
$("#contentnews").load("/scripts/pagination_data.php?page=" + pageNum, Hide_Load());
});
});
</script> |
Et le code pour la pagination :
Code:
1 2 3 4
| <li id="1">1</li>
<li id="2">2</li>
<li id="3">3</li>
<li id="4">4</li> |
Et voici les erreurs :
- Erreur: document type does not allow element "img" here
il concerne l'image dans #loadingnews
- Erreur: value of attribute "id" invalid: "1" cannot start a name
il concerne la liste 1.2.3.4
Quelle sont les modifications que je peux y apporter pour êtres W3C compatible ?
Merci