I am in need to open a pop-up message when my client clicks the link to open an internal application. The message is provided in the alert function. When the user closes the alert, I want him/ her taken to the internal application, for which the link is provided in window.location func. But as told, I am receiving the error - The function is not defined. Pls guide me through this.
<script type="script/javascript">
function AlertIt(){
var answer = alert("Don't Leave them Unattended!\nAlways ask - Do You Use Tobacco?\nIf Yes -> REMEMBER TCC\nWe are here to HELP & EASE\nYou and Your Patients.")
if(answer)
window.location="internal-application-url";
return false;
}
<div class="menuItem">
<a href="javascript:AlertIt();"><b>MVR-HIS</b></a>
</div>
You should change the type
attribute of <script>
tag to "application/javascript"
. Or you can remove that type attribute from the tag.
User contributions licensed under CC BY-SA 3.0