A problem mobile browser an audio playing.

A problem mobile browser an audio playing.

Please help me friends.

I wrote this code
  1. $("#loginbutton").click(function(){
  2. var user=$('#log-username').val();
  3. var pass=$('#log-password').val();
  4. $.post("<?=$siteurl?>inc/process.php?do=login",{loguser:user,logpass:pass},function(logdata){
  5. logcontrol=logdata;
  6. if (logcontrol=="t") { logmsg='Giriş Başarılı.'; }
  7. if (logcontrol=="u") { logmsg='Kullanıcı adı boş bırakılamaz!'; }
  8. if (logcontrol=="p") { logmsg='Parola boş bırakılamaz!'; }
  9. if (logcontrol=="upf") { logmsg='Kullanıcı adı ve parola boş bırakılamaz!'; }
  10. if (logcontrol=="f") { logmsg='Kullanıcı adı veya parola hatalı!'; }
  11. if (logcontrol=="pf") { logmsg='Parola boş bırakılamaz!'; }
  12. if (logcontrol=="uf") { logmsg='Kullanıcı adı boş bırakılamaz!'; }
  13. new jBox('Notice', {
  14. theme: 'NoticeFancy',
  15. attributes: {x: 'left', y: 'bottom'},
  16. color: 'red',
  17. content: logmsg,
  18. audio: '<?=$siteurl?>assets/jquery/audio/bling2',
  19. volume: 80,
  20. animation: {open: 'slide:bottom', close: 'slide:left'}
  21. });
  22. });
  23. }); 

But audio not playing on mobile devices. And ı wrote this code. This code can playing audio but text is before click text. :( eg.

First click. No Show Message
I write username
Second click Message: Username and password are empty
Third click. password is empty
I write password
Fourth click message. passwrod is empty
Fifth Click. Login successfull

  1. $("#loginbutton").click(function(){
  2. var user=$('#log-username').val();
  3. var pass=$('#log-password').val();
  4. $.post("<?=$siteurl?>inc/process.php?do=login",{loguser:user,logpass:pass},function(logdata){
  5. logcontrol=logdata;
  6. if (logcontrol=="t") { logmsg='Giriş Başarılı.'; }
  7. if (logcontrol=="u") { logmsg='Kullanıcı adı boş bırakılamaz!'; }
  8. if (logcontrol=="p") { logmsg='Parola boş bırakılamaz!'; }
  9. if (logcontrol=="upf") { logmsg='Kullanıcı adı ve parola boş bırakılamaz!'; }
  10. if (logcontrol=="f") { logmsg='Kullanıcı adı veya parola hatalı!'; }
  11. if (logcontrol=="pf") { logmsg='Parola boş bırakılamaz!'; }
  12. if (logcontrol=="uf") { logmsg='Kullanıcı adı boş bırakılamaz!'; }
  13. });

  14.                         new jBox('Notice', {
  15. theme: 'NoticeFancy',
  16. attributes: {x: 'left', y: 'bottom'},
  17. color: 'red',
  18. content: logmsg,
  19. audio: '<?=$siteurl?>assets/jquery/audio/bling2',
  20. volume: 80,
  21. animation: {open: 'slide:bottom', close: 'slide:left'}
  22. });
  23. });