Friday, October 19, 2012

uncaught TypeError: Property href of object is not a function

Dear Readers,

I face this problem in a web application build in .aspx. It mainly occurs when you are performing some action with javascripting or Jquery. In my case, I was using javascript. It was working fine in IE (Internet Explorer) but was unable to perform any action in chrome.

If you read subjected error message carefully, it tells you that you are accessing an object as function which is not a function at all.

In my case, I mistakenly access window.href as a function. for example, I wrote it as

window.href('www.google.com');

which is wrong and that is why it was not functioning properly in chrome. The correct method is

window.href= 'www.google.com';

I hope that after reading my post, you will able to understand that where you are doing mistake and correct it.

If this post help you then post your comments so that others can also consider this as a worth information.

Thanks.

5 comments:

Anonymous said...

Brilliant, thank you!

Anonymous said...

Thanks!

sudhan said...

Great..! big re-leafing to me from 2 days

sudhan said...

great.. its big re-leaf to me..thanq

Roadirsh said...

Thx a lot !