简体   繁体   中英

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.

it's not supposed to go look for it in 'Interact' in first place but in '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 :

<%@ 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 obj = new myHandler();

to something else like

var mh = new myHandler();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM