Quantcast
Channel: SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 789

Give an error/warning sound to the user when an error occurs in Application

$
0
0

Here we go. It is a very helpful example for make user friendly application by using HTML5 audio tag. When an error occurs, users can be notified by a sound.


In index.html write this:

<body class="sapUiBody">  <div id="content"></div>  <audio id="idErrorSound">  <source src="audio/ErrorSound.mp3"></source>  </audio></body>

Now write a small javascript which can be called from your application when you found an error/mistake done from user end:

function playErrorSound() {  var audio = document.getElementById("idErrorSound");  audio.play();
}

Now here we can see a small code snippet where we are calling this js written above:

if (error) {        playErrorSound();        // open a dialog to give user a message        } 

Viewing all articles
Browse latest Browse all 789

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>