[英]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.