• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Can Please Someone Customize this script

asifshaikhtsn

Member
Jan 8, 2021
42
10
8
i have this script which open any random link everytime when user click on a button but i want to to customize script like this.

like when user click 1st time on a button then 1st website will be open in new page
.
and when same user click Second time on a button then 2nd website will be open in new page
.
and When same user click Third Time on a button then Main Destination Page Will be open.

<script>
<!--
/*
*/

//specify random links below. You can have as many as you want
var randomlinks=new Array()

randomlinks[0]="http://facebook.com"
randomlinks[1]="http://gmail.com"
randomlinks[2]="http://yahoo.com"
randomlinks[3]="http://cnn.com"
randomlinks[4]="http://www.geocities.com"

function randomlink(){
window.location=randomlinks[Math.floor(Math.random()*randomlinks.length)]
}
//-->
</script>
<form method="post">
<p><input type="button" name="B1" value="Button >>" onclick="randomlink()"></p> </form>

<!--Uncomment below to use a regular text link instead
<a href="javascript:randomlink()">Random Link</a>
-->
 
i have this script which open any random link everytime when user click on a button but i want to to customize script like this.

like when user click 1st time on a button then 1st website will be open in new page
.
and when same user click Second time on a button then 2nd website will be open in new page
.
and When same user click Third Time on a button then Main Destination Page Will be open.

<script>
<!--
/*
*/

//specify random links below. You can have as many as you want
var randomlinks=new Array()

randomlinks[0]="http://facebook.com"
randomlinks[1]="http://gmail.com"
randomlinks[2]="http://yahoo.com"
randomlinks[3]="http://cnn.com"
randomlinks[4]="http://www.geocities.com"

function randomlink(){
window.location=randomlinks[Math.floor(Math.random()*randomlinks.length)]
}
//-->
</script>
<form method="post">
<p><input type="button" name="B1" value="Button >>" onclick="randomlink()"></p> </form>

<!--Uncomment below to use a regular text link instead
<a href="javascript:randomlink()">Random Link</a>
-->
if u want get fast answer and solved. i recommended ask to stackoverflow
 

Forum statistics

Threads
79,287
Messages
1,138,371
Members
247,767
Latest member
jbrilll
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock