www.webdeveloper.com
Results 1 to 3 of 3

Thread: Uncaught TypeError: undefined is not a function , data from success in ajax

  1. #1
    Join Date
    Apr 2005
    Posts
    24

    Uncaught TypeError: undefined is not a function , data from success in ajax

    Hi,
    I was trying to read the first character of a data message comming from server-side in the client side :

    $.ajax({
    url: 'assignRenameRuleToAgency.do',
    data: "ruleId=" +ruleId + "&agencyID=" + agencyID + "&disabled=" +disabled ,
    success: function(response) {
    if(response.message.charAT(0) === 'E') <--- Uncaught TypeError: undefined is not a function
    toastr.error(response.message);
    else
    toastr.success(response.message);
    }
    })

    My question is :
    is not response.message a string ?

    thanks.

  2. #2
    Join Date
    Mar 2009
    Posts
    467
    Look closely. There is no 'charAT' method for string objects, it should be 'charAt' with a small "t".
    Last edited by Tcobb; 06-12-2014 at 11:41 AM. Reason: msp'ed myself

  3. #3
    Join Date
    Apr 2005
    Posts
    24
    Tanks lot, that was a cut and past .

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
HTML5 Development Center



Recent Articles