eMoneySpace
Welcome, Guest. Please login or register.
Did you miss your activation email?
News: Earn your money online safely here at eMoneySpace. Jun 30, 2022 01:56 PM




INNER HTLM AND FUNCTION SCRIPT HELP
Print
Author Topic: INNER HTLM AND FUNCTION SCRIPT HELP  (Read 719 times)
mbuk81
Reputation: (0)
*

Offline

Posts: 240
Referrals: 2

WIN 0.01BTC FREE @ BTCQUIX.XYZ

View Profile WWW
Mar 18, 2021 12:51 AM

here is part of my script that i want the game to end and taking you to a different page instead of just restating
all the code here just not sure on how to chance the function from restating on click to going to where i want them to
if anyone can tell me what to chance will be very useful


      
         var p = 0.2;
         var scratched = 0;
         function callback(d) {
            scratched++;
            if(scratched >= cards) {
               if(win > (cards/3)) {
                  document.getElementById('result').innerHTML = 'click here to play again';
               } else {
                  document.getElementById('result').innerHTML = 'You lose, but you can try again!';
                     instructions.addEventListener('click', restartAll, true);
         }
         function restartAll() {
            instructions.removeEventListener('click', restartAll, false);
            for(var i=0, l=cardsArray.length; i<l; i++) {
               cardsArray.restart();
               cardsArray.className = '';
               isMouseDown = false;
            }
               }
            }
         }

         
Logged

JustClick
Reputation: (+60)
*

Offline

Posts: 5792
Referrals: 1


View Profile WWW
Reply #1: Mar 19, 2021 05:08 AM

in this are of inner.HTML u can display anything

document.getElementById('result').innerHTML = '<a href="page.html"><button>CLICK TO GO</button></a>';

if want to redirect ur members then modify ur code like this

instead of this
document.getElementById('result').innerHTML = 'click here to play again';

use this
location.href = "https://sitename.com/nextpage.html";


*** MAKE YOUR SCRIPT BACKUP BEFORE TRYING ANY MODIFICATION ***
« Last Edit: Mar 19, 2021 05:12 AM by JustClick » Logged

Print
 
Jump to:  
Copyright © 2008-2022 eMoneySpace. All rights reserved.