Jump to content

Object doesn't support this property or method


dlebowski

Recommended Posts

First off, do you understand the error message?  If not, the error message means you have a reference to an object, call it O, and you are using a property P or method M that the object does not have.

 

In other words, you are attempting:

alert( O.P ); // use property P of object O, if P is not there you will receive this error

alert( O.M() ); // call method M of object O, if M is not there you will receive this error

 

You have a few places in your code where this might be occurring.

 

document.getElementById() is pretty standard, so that's probably not it.

 

I'm not familiar with setProperty() on DOM methods though.  Are you sure the object returned by document.getElementById('yourmessage') has a set property method?

 

Next you have an object called raw.  Are you sure that raw has a data property?  Are you sure that raw.data is an object?  Are you sure that raw.data.yourmessage is a property?  Can raw.data.yourmessage be converted to a string?

Link to comment
Share on other sites

First off, do you understand the error message?

 

Yes, for the most part.

 

Are you sure that raw has a data property?

 

yes

 

Are you sure that raw.data is an object?

 

yes

 

Are you sure that raw.data.yourmessage is a property?

 

yes

 

Can raw.data.yourmessage be converted to a string?

 

Yes.  It is a string.

     

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.