Zmień obiekt w String JavaScript
var obj = {a: "a", b: "b" /*...*/};
var string = JSON.stringify(obj);
// OUTPUT:
// "{'a':'a', 'b':'b'}"
Vbbab
var obj = {a: "a", b: "b" /*...*/};
var string = JSON.stringify(obj);
// OUTPUT:
// "{'a':'a', 'b':'b'}"
var myJSON = JSON.stringify(obj);
String(yourobject); //r
let cookieModal = document.querySelector(".cookie-consent-modal")
let cancelCookieBtn = document.querySelector(".btn.cancel")
let acceptCookieBtn = document.querySelector(".btn.accept")
cancelCookieBtn.addEventListener("click", function (){
cookieModal.classList.remove("active")
})
acceptCookieBtn.addEventListener("click", function (){
cookieModal.classList.remove("active")
localStorage.setItem("cookieAccepted", "yes")
})
setTimeout(function (){
let cookieAccepted = localStorage.getItem("cookieAccepted")
if (cookieAccepted != "yes"){
cookieModal.classList.add("active")
}
}, 5000)