mercredi 16 novembre 2022

I'm trying to preview random photos on the site's share link

I used this function in js to open the variable in the head of the html, I don't know if there is a solution or if there is another way to do it.

function randomlink() {
  var links = new Array(3)
  links[0] = "https://raw.githubusercontent.com/vonkoln/clubenoturno/clubenoturno/pr.jpeg"
  links[1] = "https://raw.githubusercontent.com/vonkoln/clubenoturno/clubenoturno/pr0.jpeg"
  links[2] = "https://raw.githubusercontent.com/vonkoln/clubenoturno/clubenoturno/pr1.jpeg"
 

  var num = Math.round(Math.random() * 2))
}
randomlink()

In html <meta property="og:image" content=links[num]/>




Aucun commentaire:

Enregistrer un commentaire