I am receiving a Component returned failure code: 0x80040111 even though the js function is defined internally

0

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.


AlertIt() defined internally in my html file

<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;
        }

Call to AlertIt() in

<div class="menuItem">
                    <a href="javascript:AlertIt();"><b>MVR-HIS</b></a>
</div>
javascript
html
func
asked on Stack Overflow Apr 10, 2018 by Rahul Hardy

1 Answer

0

You should change the type attribute of <script> tag to "application/javascript". Or you can remove that type attribute from the tag.

answered on Stack Overflow Apr 11, 2018 by Master Po

User contributions licensed under CC BY-SA 3.0