Results 1 to 2 of 2

Thread: Uncaught TypeError: undefined is not a function. (fiddle included).

  1. #1
    Sencha User
    Join Date
    Jul 2014
    Posts
    105
    Answers
    10

    Default Answered: Uncaught TypeError: undefined is not a function. (fiddle included).

    I am trying to make some code to debug what function is called when of this object.The way i try to do this is to overwrite the existing function with a function which outputs debug information and then calls the original function. Here is a fiddle i made:



    Open the console to see debug information. The problem i have is when i call the original function with:

    Code:
    org.apply(me,arguments);
    I hope someone can help me with this.

    This is the error i get: Uncaught TypeError: undefined is not a function

  2. I found the solution myself. this solves it:

    Code:
       var funct = this[i], m = this;
    				
       this[i] = (function(){
                        var fn = i,
                            org = funct,
                            me = m;

  3. #2
    Sencha User
    Join Date
    Jul 2014
    Posts
    105
    Answers
    10

    Default

    I found the solution myself. this solves it:

    Code:
       var funct = this[i], m = this;
    				
       this[i] = (function(){
                        var fn = i,
                            org = funct,
                            me = m;

Similar Threads

  1. Replies: 15
    Last Post: 23 Mar 2015, 4:50 AM
  2. Cannot read property 'log' of undefined
    By alexander.urban in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 26 Jan 2015, 7:12 AM
  3. Replies: 3
    Last Post: 16 Dec 2014, 7:13 AM
  4. Can not read property 'fn' of undefined
    By bee in forum Ext: Q&A
    Replies: 6
    Last Post: 7 Sep 2011, 1:56 PM
  5. Help: Cannot Read Property 'id' of undefined
    By JCFMachado in forum Ext: Discussion
    Replies: 1
    Last Post: 16 Jun 2011, 3:06 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •