I am loading Amazon website inside the webview of my app and i want to show a toast message when user clicks the Buy Now button in that loaded website. What is the way to do perform this task using javascript or any other method available.
I am loading Amazon website inside the webview of my app and i want to show a toast message when user clicks the Buy Now button in that loaded website. What is the way to do perform this task using javascript or any other method available.
Try this maybe if you just want to show a message/alert
<script>
function showAlert() {
alert ("Hello world!");
}
</script>
And set the buttons onCLick property be this function. For eg.
function myFunction() {
alert("I am an alert box!");
}
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Alert</h2>
<button onclick="myFunction()">Try it</button>
</body>
</html>