• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Javascript

New Here ,
Feb 19, 2020 Feb 19, 2020

Copy link to clipboard

Copied

Bonjour,

Je me débrouille bien en html, et j'ai commencé à m'initier au javascript. Mon problème est que mon javascript ne s'affiche pas sur mon site.

j'ai ajouté dans le head <script src="serpent.js"></script>. Dans mon dossier principal j'ai un dossier script et j'ai mon fichier serpent.js dans ce dossier. En haut je vois qu'il est lié, j'ai "Code source", "favico.icon", "mon_site.css" et "serpent.js"

Quand je glisse la page ou je veux que mon jeu s'affiche, tout ce que j'ai mis en html et css affiche, mais pas le jeu.

Est ce qu'il y aurait quelqu'un qui pourrait m'aider? Merci pour votre aide.

acapy1973

TOPICS
Other , Preview , Publish

Views

795

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2020 Feb 19, 2020

Copy link to clipboard

Copied

Is below what you have at the bottom of your pages code, inserted just before the closing </body> tag?

 

<script src="scriptFolderName/snake.js"></script>

</body>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2020 Feb 19, 2020

Copy link to clipboard

Copied

Pourquoi quand j'écrie, j'écrie en blanc? La couleur blanc est par défaut je n'arrive pas à mettre le texte en noir

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2020 Feb 19, 2020

Copy link to clipboard

Copied

</main>
</div>

 

</body>
</html>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 19, 2020 Feb 19, 2020

Copy link to clipboard

Copied

osgood_ a remarqué que si votre fichier .html est à la racine, mais que votre fichier snake.js est dans un autre dossier, vous devez inclure le nom du dossier dans l'attribut script src.

Exemple: si snake.js se trouve dans un dossier nommé "script", alors l'attribut src serait src="script/snake.js".

 

osgood_ has noticed that if your .html file is in the root, but your snake.js file is in another folder, you need to include the folder name in the script src attribute.

 

Example: if snake.js is in a folder named "script", then the src attribute would be src="script/snake.js".

 

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2020 Feb 19, 2020

Copy link to clipboard

Copied

LATEST

Mon jeu du serpent apparait mais en bas de mon footer même si j'ai mis le codage dans le main. J'ai aussi essayé dans le head. Demain, je vais essayer de trouver une solution.

 

Merci encore pour votre aide

acapy1973

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines