Unable to play TypeError: 'undefined' is not an object

Google Analytics shows that about 12% of all our users are subject to Javascript errors:

TypeError: 'undefined' is not an object

90% of browsers are Safari 7534.48.3, 10% is an agent compatible with Mozilla. 75% of errors come from the iPhone, 23% from iPads. 1% from Macintosh, the remaining 2% from iPod, etc. None of the devices runs Linux or Windows.

I tried to enable debug mode in safari on iPhone and iPad, but could not reproduce the error.

Here is the link to the page. Google Analytics requests display an error . If someone can consistently reproduce the error here, I will be very happy because just the line number will be enough to start debugging.

Can anyone think of other ways that I can try to debug? Thanks everyone

For the curious among us, I use this code to send errors to GA - Warning : Possible self-esteem.

Update: TypeError: 'undefined' is not an object (rating "safari.self.tab.canLoad")

I managed to get it out of it once by clicking around, mainly on the iphone, by clicking "Change country .."

Update:. Solved by making sure the item is available in dom. It turns out that the ajax call to success was trying to write an element that was not available.

I saved a hard record. Cannot play TypeError: 'undefined' is not an object here

+12
javascript jquery safari iphone
source share
2 answers

In your .js functions, you have the following:

 storage_get = function(key) { var store = (window.SAFARI ? safari.extension.settings : localStorage); var json = store.getItem(key); if (json == null) return undefined; try { return JSON.parse(json); } catch (e) { log("Couldn't parse json for " + key); return undefined; } } 

undefined NOT a JavaScript keyword. This is a variable that (most of the time) is undefined. You cannot use undefined as follows. Think about what happens if you replace it with pinkelephant , as this is what happens here.

0
source share

Firstly, I am surprised that you are worried about your JavaScript error errors in GA ... You seem to have quite a few 404 error codes for a number of links.

Secondly, I found another JavaScript error that seems to me to deserve this answer:

An attempt to subscribe to email updates gives an undefined variable in the response (apparently set for the data in the function parameters):

 msh.header.js:213 ReferenceError: Can't find variable: response 
-3
source share

All Articles