Tag Archive for 'ie'

AddThis on IE – Object doesn’t support this property or method

29612v1 max 250x250 AddThis on IE   Object doesnt support this property or method
Image via CrunchBase

AddThis is a great service – it allows robust integration with online services, e.g. Facebook, Twitter, LinkedIn, del.icio.us. What you need to do is to get your button’s code on AddThis homepage and use it in your project. Additionally you can configure the widget; you can refer to AddThis API, where you can find needed information and examples.

I created a component which I included on a couple of pages. I was very happy to use it until I started testing my pages on different browsers. It turned out there was a problem on IE (only; why didn’t that surprise me…); in two of three places it worked just fine but in one place I was getting JavaScript error:

jserror 350x234 AddThis on IE   Object doesnt support this property or method

As usual JavaScript error message on IE gave little (if not zero) information on the error. The only statement to give was the problem was on AddThis side. Unfortunately debugging their code was not the best case because the referenced library was obfuscated and (rather not) dedicated to a human being.

Continue reading ‘AddThis on IE – Object doesn’t support this property or method’

IE7 – problems with onchange event for text field when auto complete used

Imagine you have a text field in the form which is defined as below

<input type="text" name="fake" id="fake" onchange="doSth()" />

Apparently doSth() will not be called at all if you are running IE7 and use its auto completion mechanism. If you bind doSth() with onblur that won’t solve the case either.

Solution

The best solution is to call doSth() only when the form is submitted. That seems to be the safest option.

Unfortunately, there might be cases when doSth() must be called immediately after leaving the input, not only at the submit time. Any ideas here?

Microsoft JScript runtime error: Object doesn’t support this property or method.

Yesterday I spent two hours analyzing this issue, which of course I had only with Internet Explorer…

As the background: I wrote a library that would make a table sortable and paginable. I decided to use prototype.js and script.aculo.us. I tried to test the result not only in Firefox which I use by default, but then I simply forgot… Then, when I run the page I got the error:

Microsoft JScript runtime error: Object doesn’t support this property or method.

At the end of the day, (after cutting JavaScript files into slices) I found the reason. All because I created HTML elements like follows (this example uses Builder of script.aculo.us):

$(this._sPaginationSecId).appendChild(Builder.node('span', { class: 'disabled' }, '<'));

If you look at that closer, you will find out that class is not put inside apostrophes (‘). Changing the above snippet to the one below will solve the case:

$(this._sPaginationSecId).appendChild(Builder.node('span', { 'class': 'disabled' }, '<'));

Important!
Be careful with defining properties like href and class with Builder.node() (of script.aculo.us) and new Element() (of prototype).


It’s also possible to define class name of a DOM object created with prototype.js or script.aculo.us using className as a parameter (instead of od 'class'):

$(this._sPaginationSecId).appendChild(Builder.node('span', { className: 'disabled' }, '<'));
 Microsoft JScript runtime error: Object doesnt support this property or method.