阅读背景:

0x800a138a - JavaScript运行时错误:AJAX调用中预期的函数

来源:互联网 

Please see the code below:

请参阅以下代码:

<script type="text/javascript"  src="Javascript/json2.js"></script>
     <script type="text/javascript" src="Javascript/jquery-1.11.1.min.js"></script>
<script type = "text/javascript">
function GroupUSNChange() {
        alert("got here");
        var frm = document.forms[0];
        var usn = document.getElementById("ctl00_ContentPlaceHolder1_hfUSN");
        for (i = 0; i < frm.elements.length; i++) {
            if (frm.elements[i].type == "checkbox" && frm.elements[i].name.substr(0, 38) == "ctl00$ContentPlaceHolder1$RematchGroup") {
                if (frm.elements[i].checked == true) {

                    var id = frm.elements[i].name.split("|");
                    alert(id[1]);
                    alert(id[2]);
                    alert(usn.value);

                    $.ajax({
                        type: "POST",
                        url: "frmPNList.aspx/ChangeGroupOfUSNs",
                        contentType: "application/json; charset=utf-8",
                        data: JSON.stringify({ strNewUSN: usn, strURNs: id(1), strDatasetName: id(2) }),
                        dataType: "json",
                        success: OnSuccess(response),
                        error: function (xhr, errorType, exception) {
                            var errorMessage = exception || xhr.statusText; //If exception null, then default to xhr.statusText  
                            alert("there was an error changing USNs: " + errorMessage);
                        },
                        failure: function (response) {
                            alert('there was a problem changing USNs.')

                        }
                     });
                    function OnSuccess() {
                        return function (response) {
                            //alert('got here 2')
                            alert('Successfully changed USNs')
                        }
                    }



                }
            }
        }
    }
</script>
<script



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: