Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Resolu]Problème en javascript

Featured Replies

Posté(e)

Bonjour, j'ai un ptit truc tout con à faire en javascript, un tableau de multiplication avec en première ligne et première colonne les numéros de ligne/colonne, seulement j'ai rien du tout qui s'affiche sur la page, même un simple document.write("test") avant les traitements n'affiche rien.

Voici le code :

<html>
<body>
<script type="text/javascript">
document.write("test")
document.write("<table align = center>")
for ( int i = 0; i < 10; i++ )
{
document.write("<tr>")
for ( int j = 0; j < 10;j++ )
{
 if( i == 0 )
 {
  if ( j == 0 )
  {
   document.write("<td></td>")
  }
  else
  {
   document.write("<td>"+i+"</td>")
  }
 }
 else
 {
  if ( j == 0 )
  {
   document.write("<td>"+j+"</td>")
  }
  else
  {
   document.write("<td>"+i*j+"</td>")
  }
 }
}
document.write("</tr><tr>") 
}
document.write("</table>")
</script>
</body>
</hmtl>

Modifié par LePhasme

Posté(e)

J'ai trouvé ce qui cloche : dans tes boucles "for", il ne faut pas déclarer le type (int) des variables. C'est bon en Java, pas en Javascript.

Donc :

for (i=0; i<10; i++)  { etc... }

Posté(e)
  • Auteur

Corrigée aussi, mais ca fonctionnait pas, par contre quand on rajoute le premier <tr> ou plutot d'après ce code la qu'on en ouvre pas 2 de suite et ensuite n'en fermer qu'un seul,...ca fonctionne...

Je cherche activement une corde pour me pendre.

( Merci pour ton aide :francais: )

Modifié par LePhasme

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.