'undefined' is undefined in ios5 - javascript

I upgraded to ios5 and my little app o longer works. I am getting a really nebulous error
JavaScript error undefined type error 'undefined' is not an object
The problem is, I don't have a variable called undefined.
I am also getting a cache manifest error
Application cach manifest has an incorrect Mime type image/png
Which I believe is a result of my script converting an svg canvas to a png (it worked in its 4). Any help with this weird, nebulous undefined error would help. I tried using alerts to try and see what variable is being declared undefined, but the error simply states undefined is not an object and gives no variable name or even what line of code the error appears on.
Code below
Can not properly format code from iPad despite using menu buttons, please try the link below and view source.
You can view it here lesserslavery.org/ice.html

The undefined-error means you are trying to access a variable in an object way, even though the object is not defined. Probably you are assuming somewhere that certain element was assigned for the variable, which it wasn't.
For the mime type question, your server probably is sending wrong mime type with the file defined in cache.manifest. Check possible explanation here: Debugging html5 offline web apps

Related

Meteor - Error when loading/refreshing page: Exception from Tracker afterFlush function: undefined

As described above, I am getting an error and an empty page (but the layout including the navbar is there) is shown. This error always occurs, when I refresh the link via the browser or in case I access the link directly through the browser. Everything is fine, when I use my navigation bar to navigate through the templates. So, I canĀ“t see any data after a real "load" of the page.
I am using Meteor Blaze on Windows.
Here is a screenshot:
Neither the picture, nor other data is shown.
I am not sure, if this is 100% the reason for that behavior, but always if this behavior occurs, I get this error message in the client console:
Exception from Tracker afterFlush function: undefined
and
TypeError: Cannot read property 'username' of undefined
at Blaze.TemplateInstance. (http://localhost:3000/app/client/templates/common/navigation.js?hash=142e989d312ba94a4b875a71e5e557bdd5255272:3:40)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3398:22
at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3744:12)
at fireCallbacks (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3394:12)
at Blaze.View. (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:3487:5)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1845:14
at Object.Blaze._withCurrentView (http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:2271:12)
at http://localhost:3000/packages/blaze.js?hash=f33d3dfed63a491d24e3aa07ad66c24b5fe8c761:1844:15
at Object.Tracker._runFlush (http://localhost:3000/packages/tracker.js?hash=997515fa2d5b0530ba07741da556c4b36963ef3b:548:11)
at onGlobalMessage (http://localhost:3000/packages/meteor.js?hash=6d285d84547b3dad9717a7c89c664b61b45ea3d8:398:23)
undefined
I searched for tracker, afterFlush etc., but I am not sure what I have to change in my code?
When you load this route "fresh" (using a refresh or pasting the url into the browser) Meteor reloads the entire application including the Meteor.user() object. At line 40 of client/templates/common/navigation.js you are probably trying to access Meteor.user().username but Meteor.user() hasn't yet loaded so you get the error. You need to defend against this in your code and/or show a loading template until your subscriptions and the user object are all ready.
The first line of the error dump points to the error:
TypeError: Cannot read property 'username' of undefined at Blaze.TemplateInstance.
(http://localhost:3000/app/client/templates/common/navigation.js?hash=142e989d312ba94a4b875a71e5e557bdd5255272:3:40)
The :40 at the end there is the line number the error occurred on.

Unknown iOS Chrome Javascript error - fillForm

Through a bug reporting framework, I've received a number of javascript errors coming from Chrome on iOS (multiple users). I suspect they have to do with Chrome's autofill.
The error is:
TypeError: null is not an object (evaluating 'c.addEventListener')
Where c varies (probably due to our script minification).
The stack trace indicates it's not coming from our script, but from somewhere on the page
index.html:11 fillForm
index.html:1 global code
Additionally, it appears that the last thing the user does is click on an input element.
Has anyone experienced this before? Does anyone know what's causing this error or how to prevent it?
This type of errors occurs when you try to execute method on null object. In your situation 'c' is null. That's why you have this error. If this string of code is yours (c.addEventListner), then simply add check for null and execute code if it's not null. If this part is from the framework, then you should check why your modifications makes it null. If not, fill bug report to framework development team.

Runtime Change of an Object in Web Browser during Automation using sahi

I am using Sahi as the Automation tool but I have a problem identifying one of the fields.The field gets changed during runtime and I am unable to catch it.
I am attaching the image here.
The fields Read and Skipped are both identified by the below properties:
Read
_div("0[1]")
_div("cell-right fg-000000[1]")
_div(613)
Skipped
_div("0")
_div("cell-right fg-000000")
_div(615)
However the array [1] gets on interchanging and i am getting the below error everytime i execute the script.
_sahi.setServerVarForFetch('___lastValue___1429772452227', _getText(_div("cell-right fg-000000[1]"))); [9205 ms] [12:31:00.321]
Error: The parameter passed to _getText was not found on the browser
at: (C:\sahi_pro\userdata\scripts\TLMRP.sah&n=40) checkFileExist
Please help as to how to identify the same.
If I understand correctly and you just have this field which id is changing, use a regular expression to get it
_div(/fg-000000/)

Collection become undefined after deploy on Meteor.com

On my computer it's work well. After deploying on meteor.com I get error.
Creating collection look like this ( /lib/collections/messages.js )
Messages = new Meteor.Collection('messages');
On browser console after input
Messages.insert({})
I get
Uncaught ReferenceError: Messages is not defined
Its very likely you have a syntax error somewhere in your code.
If you check up your browser console the syntax error is visible.
On your localhost the files are not concatenated into one single js file, so if there is an error somewhere, then the issue isn't too bad & your app will run fine, mostly.
The thing is when your entire project is concatenated into one single js file then when there is an error higher up in your code, the downstream code will not execute. So the code at /lib/collections/messages.js does not run & this is why it is not defined.
The error is likely to be something like cannot read null of undefined or uncaught reference error or something like that. If you solve whatever is causing this error and redeploy your app.

jQuery.tokenInput.js script in JavaScript not working

I am making an application that is purely out of JavaScript (frontend and backend). So now I am using jQuery.tokenInput.js and I am having some troubles with the plugin recognizing the script.
First of all, it's not logging any error messages so I don't even know if it's an issue on my end or not.
I've essentially created a route in the application /autocomplete/tags and it accepts q parameter as well.
So when I type in something like this /autocomplete/tags?q=r I get the following result on the page
[{"tag_name":"Android","_id":"ooJaBpZ6MShmzbshY"},{"tag_name":"RPG","_id":"KpvAqCRqKKP5rbGLD"}]
So now when I initialize the plugin like this
$('#tag_input').tokenInput("/autocomplete/tags", {
theme: "facebook",
propertyToSearch: "tag_name",
tokenLimit: 5
});
It changes the input and everything. I've even tried with constant data and it seems to work but not with a script for some reason.
Is there a way I can debug/troubleshoot? Can I somehow turn on logging for this plugin? I don't actually see any issue with the way that I am doing it. I've looked at the demos and they return JSON in exactly the same way.
If you've got any ideas, it would be great!
The JSON returned from an external service must be returned under an application/json header type - we found that this service was returning text/html instead.
Information about how to specify the content type with Meteor can be found on this question.

Categories

Resources