[JAVAScript] Porblème d'insertion

Résolu
Barichon Messages postés 19 Date d'inscription   Statut Membre Dernière intervention   -  
Barichon Messages postés 19 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,

J'aimerais inserer ce code dans ma paghe php:

function Scroller() { 
window.scrollBy(0,100); 
} 
setTimeout("Scroller()", 500);


J'ai mis integrer donc mon code dans ma page php de cette façon:

<?php

echo "<SCRIPT LANGUAGE=\"JavaScript\"> ";     
function Scroller() { 
window.scrollBy(0,100); 
} 
setTimeout("Scroller()", 500);
echo"</SCRIPT>";


page web.....

?> 


Mais quand je rafraichit ma page pour voir ce que ça me donne, j'ai une page toute blanche :(
Quelqu'un peut'il me filé la main car je ne toruve pas d'ou cela peut venir...

Merci
A voir également:

4 réponses

Groarh Messages postés 682 Date d'inscription   Statut Membre Dernière intervention   185
 
Salut,
ta fonction doit faire partie de la chaîne que tu mets dans echo. Ça m’étonne d’ailleurs que tu n’aies pas de message d’erreur…
N’oublie pas d’échapper les guillemets autour de Scroller().

;)
0
Barichon Messages postés 19 Date d'inscription   Statut Membre Dernière intervention  
 
Voila,
J'ai mis cela:

echo "<SCRIPT LANGUAGE=\"JavaScript\"> ";
function Scroller() {
window.scrollBy(0,100);
}
setTimeout("Scroller()", 500);
echo"</SCRIPT>";


mais là pour le coup j'ai une erreur de la page (page graph_view.php du logiciel de monitoring cacti)


Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/graph_view.php:8) in /usr/share/cacti/site/include/global.php on line 120

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/graph_view.php:8) in /usr/share/cacti/site/include/global.php on line 121

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/graph_view.php:8) in /usr/share/cacti/site/include/global.php on line 122

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/graph_view.php:8) in /usr/share/cacti/site/include/global.php on line 123

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/graph_view.php:8) in /usr/share/cacti/site/include/global.php on line 124

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/cacti/site/graph_view.php:8) in /usr/share/cacti/site/include/global.php on line 126

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/share/cacti/site/graph_view.php:8) in /usr/share/cacti/site/include/global.php on line 130
0
Groarh Messages postés 682 Date d'inscription   Statut Membre Dernière intervention   185
 
echo "<script type=\"text/javascript\">
function Scroller() {
window.scrollBy(0,100);
}
setTimeout(Scroller, 500);
</script>"; 
0
Barichon Messages postés 19 Date d'inscription   Statut Membre Dernière intervention  
 
c'est bon merci j'ai trouvé ;)
0