Sunday, 30 May 2021

Javascript Confirm not working in Godaddy

From here, https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_confirm

<!DOCTYPE html>
<html>
<body>

<p>Click the button to display a confirm box.</p>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
  confirm("Press a button!");
}
</script>

</body>
</html>

Everything works well. But when I try it in Godaddy HTML block. It does not work.In Godaddy, Button is seen but when I click button nothing happens so it does not work although design is not problematic.

How can I make it work? Is it possible to run confirm method in Godaddy HTML Block? In fact I can run different Javascript features / code like local storage or document.execCommand("copy"); without any problem in Godaddy. But Javascript confirm method does not working in Godaddy. How can we solve it?

Edit: You can provide alternative solution to ask user "yes" - "no" question in Godaddy by using Javascript - HTML. My aim is to ask user "Are you sure to do this?" I mean you can provide a solution rather than confirm.



from Javascript Confirm not working in Godaddy

No comments:

Post a Comment