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?