Results 1 to 2 of 2
  1. #1
    Allahu__Akbar's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    125
    Reputation
    15
    Thanks
    18
    My Mood
    Amazed

    Question random link button

    so i basically want to make a button that open random links in html.

    i have already managed to do it, but what i want is to have a js file with those links and a button in html file that accesses that file in order to get that link. that way nobody can inspect and see what links there are. if that is understandable.

    this is the script im using:
    Code:
    <script type="text/javascript">
    function randomlinks(){
    ****var myrandom=Math****und(Math.random()*9)
    ****var links=new Array()
    ****links[0]="https://www.javascriptki*****m"
    ****links[1]="https://www.dynamicdrive.com"
    ****links[2]="https://www.cssdrive.com"
    ****links[3]="https://www.codingforums.com"
    ****links[4]="https://www.news.com"
    ****links[5]="https://www.gamespo*****m"
    ****links[6]="https://www.msnbc.com"
    ****links[7]="https://www.cnn.com"
    ****links[8]="https://news****c.co.uk"
    ****links[9]="https://www.news.com.au"
    *
    ****window.location=links[myrandom]
    }
    </script>
    <form>
    <input type="button" value="random link!" onClick="randomlinks()">
    </form>
    i want the button to be in html file and javascript in .js file so nobody can see what links im using. any ideas how to?

  2. #2
    Allahu__Akbar's Avatar
    Join Date
    Oct 2015
    Gender
    male
    Posts
    125
    Reputation
    15
    Thanks
    18
    My Mood
    Amazed
    nwm. i found out that javascript is clientsided

Similar Threads

  1. [Help]Open link click of button[Solved]
    By iFrank1 in forum Visual Basic Programming
    Replies: 7
    Last Post: 09-04-2010, 07:05 AM
  2. New Random Combat arms Error linking to my old one
    By shawnyboi15 in forum Combat Arms Help
    Replies: 9
    Last Post: 12-11-2009, 01:57 PM
  3. Code For: Button Click = Web Link
    By Katie_Perry in forum Visual Basic Programming
    Replies: 19
    Last Post: 10-04-2009, 07:49 PM
  4. [Question] How to make a button link to a website?
    By Hax0r69 in forum Visual Basic Programming
    Replies: 8
    Last Post: 07-23-2009, 11:03 PM
  5. ok button is link???
    By cristian in forum Combat Arms Hacks & Cheats
    Replies: 17
    Last Post: 10-11-2008, 09:30 PM