dlebowski Posted February 18, 2010 Share Posted February 18, 2010 Hi. Why do I get this message when doing this in IE: document.getElementById('yourmessage').setProperty('value', decodeURIComponent(raw.data.yourmessage)); <input type='hidden' id="yourmessage"> Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted February 18, 2010 Share Posted February 18, 2010 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? Quote Link to comment Share on other sites More sharing options...
dlebowski Posted February 18, 2010 Author Share Posted February 18, 2010 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. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted February 18, 2010 Share Posted February 18, 2010 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? Quote Link to comment Share on other sites More sharing options...
salathe Posted February 19, 2010 Share Posted February 19, 2010 Perhaps you're looking to use setAttribute (or .value directly if you want to be old-school)? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.