pinterest / widgets

JavaScript widgets, including the Pin It button.
Other
211 stars 88 forks source link

Unable to get property 'toLowerCase' of undefined on IE10 #68

Closed joeljv91 closed 7 years ago

joeljv91 commented 8 years ago

Hi.

I was testing this widget on IE10 and I found this error causing the widget doesn't load in this browser. In IE11 and Edge works fine.

// nothing? use default
if (!lang) {
    lang = $.a.defaults.lang;
}
lang = lang.toLowerCase(); <--- I think lang is null in this line on IE10

https://github.com/pinterest/widgets/blob/master/pinit_main.js#L1580

Thanks.

javery014 commented 8 years ago

I am also experiencing this same issue

javery014 commented 8 years ago

@joeljv91 For me, the pinterest icon wasn't showing up visually in IE10. I'm not sure if this javascript error was causing this or not, but what I did which solved my issue was I added an img tag in the anchor tag, like how they have on their Pin It Button documentation page.

<a href="https://www.pinterest.com/pin/create/button/">
    <img src="//assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png" />
</a>

Previously to get the default Pin It image, I was following the examples at the bottom of the page where there is no img tag in between the anchor tag. My guess is the img tag is there as a fallback for IE10, because in all other browsers, my code functions the same with or without the img tag.

vatavale commented 8 years ago

I am also experiencing the same issue

clewott commented 8 years ago

I am experiencing the same issue within IE 10.

neilmuralee commented 8 years ago

I am also experiencing the same issue IE9 & 10

corporealfunk commented 8 years ago

Also occurs in IE 8

kentbrew commented 7 years ago

Please re-open if you're seeing this in IE11. IE < 11 are not officially supported on Pinterest, so you're going to see inconsistent results.

RaajeshPn commented 4 years ago

vendor.js (45797,9)

ERROR TypeError: Unable to get property 'toLowerCase' of undefined or null reference

vendor.js (15103,25)

[object Error]: {description: "Unable to get property 'toLowerCase' of undefined or null reference", message: "Unable to get property 'toLowerCase' of undefined or null reference", number: -2146823281, stack: "TypeError: Unable to get property 'toLowerCase' of undefined or null reference at HttpXsrfInterceptor.prototype.intercept (http://localhost:4200/vendor.js:9166:9) at HttpInterceptorHandler.prototype.handle (http://localhost:4200/vendor.js:8406:9) at HttpInterceptingHandler.prototype.handle (http://localhost:4200/vendor.js:9238:9) at Anonymous function (http://localhost:4200/vendor.js:8145:18) at MergeMapSubscriber.prototype._tryNext (http://localhost:4200/vendor.js:71908:13) at MergeMapSubscriber.prototype._next (http://localhost:4200/vendor.js:71898:13) at Subscriber.prototype.next (http://localhost:4200/vendor.js:67194:13) at Anonymous function (http://localhost:4200/vendor.js:76613:9) at Observable.prototype._trySubscribe (http://localhost:4200/vendor.js:66650:13) at Observable.prototype.subscribe (http://localhost:4200/vendor.js:66634:13)"}

[WDS] Live Reloading enabled. vendor.js (84533,5)

RaajeshPn commented 4 years ago

How to fix this issue