vendredi 1 janvier 2016

javascript random number variable to php

Hello i use javascript to roll a dice and pick random number. After this the script have to show this number in the div box and make a variable with the number. The problem is that it's starting from 1 and picking numbers +4...(example: 1st pick - 1, 2nd pick 5, 3th pick 9, 4th pick 13 etc) it's not picking random number...

This is the code for random pick:

var loop = setInterval(function(){
                    $('.rolling_bet').html(getRandomInt(0, 9999));
                }, 100);

and this is the code for transfering the variable to php:

$.post( "http://localhost/play.php", {'amount': amount, 'type': type, 'loop': loop}, function( data ){    (etc..)

am i right to use "loop" variable to post it or my javascript code is wrong?




Aucun commentaire:

Enregistrer un commentaire