# Warning Line 142, Column 54: character "&" is the first character of a delimiter but occurred as data .

Code javascript : Sélectionner tout - Visualiser dans une fenêtre à part
if((a.getAttribute("rel").indexOf("style") != -1) && (a.getAttribute("title"))) {



This message may appear in several cases:

* You tried to include the "<" character in your page: you should escape it as "&lt;"
* You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
* Another possibility is that you forgot to close quotes in a previous tag.

# Warning Line 142, Column 55: character "&" is the first character of a delimiter but occurred as data .

Code javascript : Sélectionner tout - Visualiser dans une fenêtre à part
if((a.getAttribute("rel").indexOf("style") != -1) && (a.getAttribute("title"))) {



This message may appear in several cases:

* You tried to include the "<" character in your page: you should escape it as "&lt;"
* You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&amp;", which is always safe.
* Another possibility is that you forgot to close quotes in a previous tag.

Quand je passe les && en &amp; pour passer la validation le code javascript évidemment ne marche plus. Que faire ?

J'ai inclus dans ma page XHTML le fichier calendar.php qui contient le code javascript. (phpcollab)

Voici la fonction concernée.
Code javascript : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if((a.getAttribute("rel").indexOf("style") != -1) && (a.getAttribute("title"))) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
  document.getElementById("style").innerHTML = title;
  return false;
}