Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

update head tag metadata vue

created() {
  fetch('test.json')
    .then(resp => resp.json())
    .then(items => {
      this.items = items;
      const descEl = document.querySelector('head meta[name="description"]');
      const titleEl = document.querySelector('head title');

      descEl.setAttribute('content', items[0]['meta-desc']);
      titleEl.textContent = items[0]['meta-title'];
    })
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to dynamically populate pdf with pdfmake node 
Javascript :: javascript parallax effect 
Javascript :: vue add watcher 
Javascript :: cheapest node js hosting 
Javascript :: slimscroll javascript 
Javascript :: pub js npm 
Javascript :: crypto js 
Javascript :: trim text 
Javascript :: node js login and registration 
Javascript :: basics of switch case and if else 
Javascript :: js color contrast ratio 
Javascript :: how to get the current username with wscript 
Javascript :: Origin http://localhost:3002 is not allowed by Access-Control-Allow-Origin. 
Javascript :: speech to text in js 
Javascript :: what is an arrow function and how is it used in react 
Javascript :: js get folder of current script 
Javascript :: ejs layout 
Javascript :: sintax arrow function in javascript 
Javascript :: how to perform transaction with sequelize 
Javascript :: d-block d-none js 
Javascript :: javascript repeat function 
Javascript :: Use jsx extension react-native 
Javascript :: sequelize 
Javascript :: javascript log where function was called 
Javascript :: documentelement javascript 
Javascript :: wild card select jquery 
Javascript :: react useref hook 
Javascript :: what is react reveal 
Javascript :: javascript allow only numbers in input alert 
Javascript :: usecallback in react 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =