There is a client application that loads javascript from a remote server as follows:

<script type="text/javascript" src="http://192.168.0.1/ind.php"></script> 

How to make the src generated random every time? Namely src="http://192.168.0.1/ind?=rand.php

? = rand - this is the part.

  • one
    document.getElementById (' ваш_скрипт ') .src = "http://192.168.0.1/" + "случайное_число" + ".php" random_number "http://192.168.0.1/" + "случайное_число" + ".php" , and the random_number depends on your criteria and is set via Math.random - lexxl
  • @lexxl Unfortunately, you cannot use getElementById in the client. Writes getElementById is not a function. - toog

0