简体   繁体   English

未捕获的TypeError:对象# <YYY> 没有方法“ xxx”

[英]Uncaught TypeError: Object #<YYY> has no method 'xxx'

I get this error: 我收到此错误:

Uncaught TypeError: Object #<Interact> has no method 'getmyData'

the problem is that it's true! 问题是,这是真的!

'Interact' has no method 'getmyData' it's 'myhandler' that contains it. 'Interact'没有方法'getmyData',包含它的是'myhandler'。

it's not supposed to go look for it in 'Interact' in first place but in 'myhandler' ! 它不应该首先在“交互”中寻找它,而在“ myhandler”中寻找它!

I have no clue why its acting like this because everything was working fine and suddenly i get this error! 我不知道为什么会这样,因为一切正常,突然我收到了这个错误!

Some code: 一些代码:

myHandler.ashx : myHandler.ashx:

<%@ WebHandler Language="C#" Class="myHandler" %>
...
public class myHandler : JsonRpcHandler, IRequiresSessionState
{

[JsonRpcMethod()]
public string getmyData()
{
.. 
}

i call it in my script: 我在脚本中称它为:

var obj = new myHandler();
...
listeners: {
    selectionchange: function (model, records) {

        myStore.loadData(Ext.decode(obj.getmyData()));

        }

Let me know if u need more details! 让我知道您是否需要更多详细信息!

solved seems there was an interferance or something 解决似乎有干扰或什么

all i had to do is change the name of my var: 我要做的就是更改var的名称:

var obj = new myHandler();

to something else like 像其他东西

var mh = new myHandler();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Microsoft.AspNet.SignalR:获取未捕获的TypeError:Object# <Object> 没有方法&#39;登录&#39; - Microsoft.AspNet.SignalR: Getting Uncaught TypeError: Object #<Object> has no method 'Logon' XXX类型无法分配给服务YYY - The type XXX is not assignable to service YYY MS Bot构建器IForm无效类型异常:具有xxx期望yyy - MS Bot builder IForm Invalid Type Exception:Has xxx Expect yyy SharePoint自定义Web部件对对象&#39;xxx&#39;,数据库&#39;yyy&#39;,所有者&#39;dbo&#39;抛出SELECT权限被拒绝 - SharePoint Custom Web Part throws SELECT permission denied on object 'xxx', database 'yyy', owner 'dbo' 未捕获的TypeError:无法调用未定义的方法“ Where” - Uncaught TypeError: Cannot call method 'Where' of undefined 值xxx对yyy无效。 错误的日期时间格式 - The value xxx is not valid for yyy. Wrong datetime format 拒绝访问路径“ Global \\ {xxx} _YYY-YYY:13552”。 迟发型? - Access to the path 'Global\{xxx}_YYY-YYY:13552' is denied. Hangfire? UWP C#:在名称空间yyy中找不到名称xxx - UWP C#: The name xxx cannot be found in namespace yyy 无法从单例yyy中使用作用域服务xxx - Cannot consume scoped service xxx from singleton yyy XXX的最佳重载方法匹配具有一些无效的参数 - The best overloaded method match for XXX has some invalid arguments
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM