How to solve “Microsoft JScript runtime error: '[Method Name]' is undefined”

后端 未结 1 1998
野性不改
野性不改 2021-01-14 13:10

Here is my code:

<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"Default.aspx.cs\" Inherits=\"WebClient._Default\" %>


        
相关标签:
1条回答
  • 2021-01-14 13:26

    Looks like the script tag for jquery is not closig properly unless you put a tag to close it, which renders those objects not readable, which gives you the error.

    Code below, hope this helps.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebClient._Default" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
        </script>
        <script>
            var count = 0;
            function Start()
            {
                setInterval("ReadNotification()", 5000);
            };
            function ReadNotification()
            {
                alert(++count);
            };
        </script>
    </head>
    <body onload="return Start();">
    
    </body>
    </html>
    
    0 讨论(0)
提交回复
热议问题