Real-time database verification script

Asked

Viewed 558 times

-4

I wanted to make a script, where the page appeared:

"Loading.", "Loading."" Loading...". The 3 loadings would change constantly and when to insert a result into the banco de dados loading would disappear and the value entered in banco de dados.

How would I do such a thing with javascript in real time and php for consultation of data from mysql?

Thank you

  • 1

    What have you tried?

  • I’ve tried to do the system, but I don’t know how long ago, I’m sorry but I’m new.

  • @Gonçalo posts the code you’ve tried, it’s easier for someone to help you.

  • I haven’t tried the part about getting data because I don’t know.

  • Can anyone help?

2 answers

1

I started a Javascript timer with every few seconds changing the text example:

<script>
var cont=0;

function nexload(){
cont++;
cont%=3;
var pontos='';
for(var i=0;i<cont;i++)
     pontos+='.';
document.getElementById('texto').innerHTML = 'Carregando'+pontos;
}

new Timer(1000,function(){nextvalue();}).start();
</script>

0

You can do this using ajax and while the request is made, you can display a message on the screen to the user.

  • Good afternoon, can you give me example of code?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.