Navigazione

    Privacy - Termini e condizioni
    © 2020 Search On Media Group S.r.l.
    • Registrati
    • Accedi
    • CATEGORIES
    • Discussioni
    • Non letti
    • Recenti
    • Hashtags
    • Popolare
    • Utenti
    • Stream
    • Interest
    • Categories
    1. Home
    2. valentino.g
    3. Post
    V

    valentino.g

    @valentino.g

    • Profilo
    • Chi segue 0
    • Da chi è seguito 0
    • Discussioni 1
    • Post 4
    • Migliore 0
    • Gruppi 0
    Iscrizione Ultimo Accesso
    Località Siena
    0
    Reputazione
    4
    Post
    0
    Visite al profilo
    0
    Da chi è seguito
    0
    Chi segue
    User Newbie

    Post creati da valentino.g

    • RE: come usare i Meta Language Attribute tag?

      Nel tuo caso è sufficiente impostare l'attributo lang sul tag html:

      [HTML]
      <html lang="it_IT>
      <!-- qui il resto del documento -->
      </html>
      [/HTML]

      postato in Coding
      V
      valentino.g
    • RE: Compilare file Json con Javascript

      Per scaricare un file JSON a partire da un form come prima cosa devi avere un form HTML, più un semplice elemento "a" a cui devi applicare l'attributo download:

      [HTML]
      <!DOCTYPE html>
      <html lang="en">
      <head>
      <meta charset="UTF-8">
      <title>Title</title>
      </head>
      <body>
      <form>
      <div>
      <label for="name">Your name:</label>
      <input id="name" type="text" name="first_name" required>
      </div>
      <div>
      <label for="last_name">Your last name:</label>
      <input id="last_name" type="text" name="last_name" required>
      </div>
      <button type="submit">SEND</button>
      </form>
      <a id="download" download>Download you file</a>
      </body>
      <script src="form.js"></script>
      </html>
      [/HTML]

      Poi nel file JavaScript che controlla il form devi:

      • gestire il submit come si fa di solito con un event listener
      • costruire un Data URL a partire da un FormData

      Quindi avrai un event listener per gestire il form, che chiama una funzione helper per costruire il link da scaricare:

      
      const form = document.forms[0];
      
      form.addEventListener("submit", function(event) {
        event.preventDefault();
        buildJSON(this);
      });
      
      

      Ecco il codice completo:

      
      const form = document.forms[0];
      
      form.addEventListener("submit", function(event) {
        event.preventDefault();
        buildJSON(this);
      });
      
      function buildJSON(form) {
        const formData = new FormData(form);
        const rawObj = Object.fromEntries(formData.entries());
        const json = JSON.stringify(rawObj);
        const dataURL = `data:application/json,${json}`;
      
        const link = document.getElementById("download");
        link.setAttribute("href", dataURL);
      }
      
      

      Nella funzione buildJSON:

      • costruiamo un oggetto form data a partire dai campi del form
      • costruiamo un oggetto JavaScript a partire dal form data
      • l'oggetto viene trasformato in JSON
      • l'attributo href del link viene valorizzato con il nostro Data URL

      Spero di essere stato d'aiuto. Ciao!

      postato in Coding
      V
      valentino.g
    • RE: Link da siti sospetti, come rifiutarli?

      Immaginavo. Grazie per le dritte!

      postato in SEO
      V
      valentino.g
    • Link da siti sospetti, come rifiutarli?

      Ciao a tutti, è il mio primo post qui.

      La mia domanda: di tanto in tanto noto nella Search Console dei backlink da siti sospetti verso il mio.

      Esempio:

      Un link verso valentinog.com/weblog/react-webpack-babel/ (che non esiste sul mio sito) da healthandtip.com/render-react-code-to-html-file-with-npm/

      Esiste un modo per "rifiutare" questi backlink? Backlink di questo tipo possono danneggiare il mio posizionamento?

      Grazie in anticipo a chi vorrà rispondere!

      postato in SEO
      V
      valentino.g