Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2972 connectés 

  FORUM HardWare.fr
  Programmation
  HTML/CSS

  Problème de validation W3C (script pris pour du HTML)

 



 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Problème de validation W3C (script pris pour du HTML)

n°1950920
caribouuu
Posté le 16-12-2009 à 15:22:47  profilanswer
 

Bonjour
 
Je suis en train de faire mon site internet, et j'ai un petit problème de validation WC3, en fait le validator me trouve 8 erreurs sur une seule ligne de code.
 
C'est une ligne de code javascript, (lien "delicious" )
 

Code :
  1. <li id="delicious" ><a href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;" title="">retrouvez mon site sur delicious</a></li>


 
Les erreurs sont exclusivement dans la partie javascript. Est-ce que quelqu'un saurait s'il y a quelque chose à faire pour que le validator comprenne que c'est pas du HTML mais un script?
 
 
 
Je vous montre les erreurs signalées par le validator, mais je suis pas sûr que ce soit utile, juste au cas ou....(j'ai le pressentiment que toutes les erreurs ont la même cause et pourraient être résolues par une manip que j'ignore. )
 

Code :
  1. 1.   Warning  Line 145, Column 121: cannot generate system identifier for general entity "noui"
  2.       …open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(
  3.       ✉
  4.       An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".
  5.       Entity references start with an ampersand (& ) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.
  6.       If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.
  7.       Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.
  8.    2. Error Line 145, Column 121: general entity "noui" not defined and no default entity
  9.       …open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(
  10.       ✉
  11.       This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (& ) in an URL or body text. See the previous message for further details.
  12.    3. Error Line 145, Column 125: reference to entity "noui" for which no system identifier could be generated
  13.       …('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(loca
  14.       ✉
  15.       This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (& ) in an URL or body text. See the previous message for further details.
  16.    4. Info Line 145, Column 119: entity was defined here
  17.       …w.open('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponen
  18.    5. Warning Line 145, Column 126: cannot generate system identifier for general entity "jump"
  19.       …'http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(locat
  20.       ✉
  21.       An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".
  22.       Entity references start with an ampersand (& ) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.
  23.       If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.
  24.       Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.
  25.    6. Error Line 145, Column 126: general entity "jump" not defined and no default entity
  26.       …'http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(locat
  27.       ✉
  28.       This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (& ) in an URL or body text. See the previous message for further details.
  29.    7. Error Line 145, Column 130: reference to entity "jump" for which no system identifier could be generated
  30.       …p://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.
  31.       ✉
  32.       This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (& ) in an URL or body text. See the previous message for further details.
  33.    8. Info Line 145, Column 124: entity was defined here
  34.       …n('http://delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(loc
  35.    9. Warning Line 145, Column 137: cannot generate system identifier for general entity "url"
  36.       …icious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'
  37.       ✉
  38.       An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".
  39.       Entity references start with an ampersand (& ) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.
  40.       If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.
  41.       Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.
  42.   10. Error Line 145, Column 137: general entity "url" not defined and no default entity
  43.       …icious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'
  44.       ✉
  45.       This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (& ) in an URL or body text. See the previous message for further details.
  46.   11. Error Line 145, Column 140: reference to entity "url" for which no system identifier could be generated
  47.       …ous.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&ti
  48.       ✉
  49.       This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (& ) in an URL or body text. See the previous message for further details.
  50.   12. Info Line 145, Column 135: entity was defined here
  51.       …elicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)
  52.   13. Warning Line 145, Column 179: cannot generate system identifier for general entity "title"
  53.       …encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title
  54.       ✉
  55.       An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".
  56.       Entity references start with an ampersand (& ) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.
  57.       If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.
  58.       Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.
  59.   14. Error Line 145, Column 179: general entity "title" not defined and no default entity
  60.       …encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title
  61.       ✉
  62.       This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (& ) in an URL or body text. See the previous message for further details.
  63.   15. Error Line 145, Column 184: reference to entity "title" for which no system identifier could be generated
  64.       …eURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'd
  65.       ✉
  66.       This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (& ) in an URL or body text. See the previous message for further details.
  67.   16. Info Line 145, Column 177: entity was defined here
  68.       …'+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.tit


Message édité par caribouuu le 16-12-2009 à 15:28:14

---------------
Bla (blaa bbla)
mood
Publicité
Posté le 16-12-2009 à 15:22:47  profilanswer
 

n°1950930
Bidem
Posté le 16-12-2009 à 15:52:23  profilanswer
 

Dans l'url que tu veux lancer, les paramètres sont séparés par des '&' or en xHTML, c'est un caractère réservé (début d'une entity).
 
C'est pourquoi il faut que tu mette &amp; à la place

Code :
  1. 'http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title)

n°1950933
pataluc
Posté le 16-12-2009 à 15:57:24  profilanswer
 

je crois qu'il veut que tu remplace tes & par des &amp; dans ton url:

Code :
  1. <li id="delicious" ><a href="http://delicious.com/save" onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;" title="">retrouvez mon site sur delicious</a></li>


 
 
 [:benou_grilled]  barbecued: ok, je vais me coucher.


Message édité par pataluc le 16-12-2009 à 15:58:28
n°1950937
caribouuu
Posté le 16-12-2009 à 16:06:36  profilanswer
 

Merci les gars ! Je vais tester ça  :jap:


---------------
Bla (blaa bbla)
n°1950941
caribouuu
Posté le 16-12-2009 à 16:34:15  profilanswer
 

Ca y est, c'est la consécration, je suis validé htmlemement conforme par le W3C :o
 
Merci encore ;)


---------------
Bla (blaa bbla)

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  HTML/CSS

  Problème de validation W3C (script pris pour du HTML)

 

Sujets relatifs
Problème de configuration MySQL sur Djangohtml, simuler la touche ctrl sur un lien
Script donnant les proprieter d'une imprimante reseauxPAGE HTML SANS CADRE POUR L INDEX ET TOUTE LES AUTRES PAGES
Protection contre injection HTMLmodifier ce script de menu avec onglet actif
probleme avec dreamweaver en mode affichage creéationcgi perl: comment fermer la connexion serveur en continuant le script
Notice Index : je n'arrive pas à résoudre le problemePHP SQL probleme ORDER BY , GROUP BY...
Plus de sujets relatifs à : Problème de validation W3C (script pris pour du HTML)


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR