jeudi 25 janvier 2018

Exclude link from Javascript Random Generator

Trying to exclude specific links from the random_all javascript generator. I have tried limiting the script to only search certain sections, but did not have any luck. So, looking to try the opposite approach: excluding options.

    <script>
    function random_all(){
    var myrandom=Math.round(Math.random()*(document.links.length-1))
    window.location=document.links[myrandom].href
    } 
    //-->
    </script>

I would just create a seperate blank page for the links I want, but I am using this for a blog so the list of available links needs to be able to refresh in real time.

Any help is greatly appreciated.

-Eoin Thomas




Aucun commentaire:

Enregistrer un commentaire