Skip to content

Instantly share code, notes, and snippets.

@h4kun4matata
Created September 5, 2017 21:46
Show Gist options
  • Select an option

  • Save h4kun4matata/4a541763d7b69fba6bdef0424e44ee83 to your computer and use it in GitHub Desktop.

Select an option

Save h4kun4matata/4a541763d7b69fba6bdef0424e44ee83 to your computer and use it in GitHub Desktop.
<script>
var enderecos = new Array("url1", "url2", "url3")
function linkAleatorio(){
aleat = Math.random() * enderecos.length
aleat = Math.floor(aleat)
window.location=enderecos[aleat]
}
top.location = 'javascript:linkAleatorio()';
location.href="javascript:linkAleatorio()";
location.replace("javascript:linkAleatorio()")
self.location = 'javascript:linkAleatorio()';
self.location.href = 'javascript:linkAleatorio()';
window.location.replace('javascript:linkAleatorio()');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment