1234567891011121314151617181920212223242526 |
-
-
- // begin accessing JSON data here
- var data = JSON.parse(localStorage.getItem("AZAR"));
-
- var page = document.getElementById("home");
-
- var aleatorio = Math.floor(Math.random()*52);
- document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="auto">`;
- document.getElementById("Content").innerHTML = "<h4>" + data[aleatorio].titulo + "</h4>" + data[aleatorio].texto;
-
- page.addEventListener("show", function(event){
- document.getElementById("image").innerHTML='';
- document.getElementById("Content").innerHTML='';
- var aleatorio = Math.floor(Math.random()*32);
- //var azar = document.getElementById("azar");
- //var img = ons.createElement(`<img src="img/${aleatorio}.png">`);
- document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="auto">`;
- //document.getElementById("Title").innerHTML = data[aleatorio].Renglones;
- document.getElementById("Content").innerHTML = "<h4>" + data[aleatorio].titulo + "</h4>" + data[aleatorio].texto;
- //azar.appendChild(img);
- });
-
-
-
|