【问题标题】:Uncaught ReferenceError: method is not defined未捕获的 ReferenceError:未定义方法
【发布时间】:2018-06-21 02:33:33
【问题描述】:

我在 Chrome 浏览器控制台中收到此错误。我的页面正在使用定义方法的外部 js 文件。页面正在识别其他方法,但未识别此特定方法。

未捕获的 ReferenceError:getBillingAndShipping_AJAX 未定义于

 <script type="text/javascript">
    //<![CDATA[
    Method1();Method2();Method3();updatecalender();UpdateItemDetailHeader();getBillingAndShipping_AJAX('0',1,0,0,'','False',''); EnableDisableHeaderInfo_ReviseOrder(false);DisableControlForContractorAndCS(true);HideDeleteForDependentItems();GetTimeDifference();hideinactive('content');$(document).ready(function() {changeoptions_user();if(typeof callAutocomplete!='undefined'){callAutocomplete();}  });$(document).ready(function () {if($.browser.msie) {$('input:radio').css({ border:'none'}); $('input:checkbox').css({ border:'none'});   } });if(typeof js_load!='undefined') js_load();
    var Page_ValidationActive = false;

这是我的服务器端脚本。 我曾尝试过 ScriptManager/ClientScript 方法,如 RegisterClientScriptBlock 和 RegisterStartUpScript,但没有运气。请帮忙。

    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Bind Billing Shipping DDL", string.Format("getBillingAndShipping_AJAX('{0}',1,1,{1},'{2}','{3}','{4}');", 
hdnFactoryID1.Value, 
miCustomerType, 
stVendorCode, 
mbIsReviseOrder, 
msEdiId), true);

【问题讨论】:

  • 为什么-ve。任何具体原因。
  • 如果你在开发者工具控制台输入getBillingAndShipping_AJAX,你会得到什么?
  • 我把它修好了。但是,我仍然喜欢听到解决方案。

标签: javascript c# jquery asp.net


【解决方案1】:

谢谢大家。我得到了修复。我在页面本身上移动了我的 js 方法,它被识别了。如果它在 js 文件中,则无法识别。我不知道为什么。很奇怪。

【讨论】:

    猜你喜欢
    • 2014-09-27
    • 2023-01-23
    • 2016-11-03
    • 2011-01-05
    • 2016-01-02
    • 2013-10-06
    • 2016-12-17
    相关资源
    最近更新 更多