Giter VIP home page Giter VIP logo

javascript-web's People

Contributors

bpesquet avatar mezcla47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javascript-web's Issues

Inclure le code JS dans une IIFE

J'hésite à englober systématiquement le code JS dans une IIFE :

(function() {
  // the code here is executed once in its own scope
})();

Je trouve que ça alourdit le code pour des débutants. Je ne l'ai pas fait pour le précédent cours JS.

bug

/*
Activité 1
*/

// Liste des liens Web à afficher. Un lien est défini par :
// - son titre
// - son URL
// - son auteur (la personne qui l'a publié)
var listeLiens = [
{
titre: "So Foot",
url: "http://sofoot.com",
auteur: "yann.usaille"
},
{
titre: "Guide d'autodéfense numérique",
url: "http://guide.boum.org",
auteur: "paulochon"
},
{
titre: "L'encyclopédie en ligne Wikipedia",
url: "http://Wikipedia.org",
auteur: "annie.zette"
}
];

// TODO : compléter ce fichier pour ajouter les liens à la page web
var divElt = document.getElementsByTagName("div");
var styleElement = getComputedStyle(divElt);

listeLiens.forEach(function (mot) {
var pElt = document.createElement("p");
pElt.textContent = mot.url + "/n Ajouté par " + mot.auteur;
pElt.style.backgroundColor = "white";

var aElt = document.createElement("a");
aElt.href = mot.url;
aElt.textContent = mot.titre;
aElt.textContent.style.color = "#428bca";

pElt.appendChild(aElt);
divElt.appendChild(pElt);

});

document.body.appendChild(divElt);

Exercice 1 Chapitre 3

@bpesquet, merci beaucoup de nous apprendre Javascript et de prendre le temps de décortiquer les bases.

Je m'interroge sur l'exercice 1 du chapitre 3 relatif à la modification de la structure de la page.
Ceci revient-il au même que votre correction :

document.getElementById("contenu").innerHTML += '<p>En voici une ' + 
    '<a href = "https://fr.wikipedia.org/wiki/Liste_des_langages_de_programmation">liste</a>' +
    ' plus complète</p>'; 

?

A savoir particulièrement, est-ce plus gourmand en ressources/ temps d'exécution que votre correction ou bien est-ce égal mais moins riche d'un point de vue pédagogique?

Merci encore pour vos cours et les exercices!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.