JS Error in Internet Explorer - javascript

I'm getting "Object Expected JS error in IE 6 and 7. I'm not able to reproduce this always. The behavior is inconsistent. I'm using Dojo Charts in my JSP page. When this error occurs none of the Charts gets loaded.
I had a similar problem with IE before. That was a JS function was called before the JS file was loaded completely. We can see the JS file in the request, but that file is empty.
I wonder why IE is not taking the JS files from cache. It works perfectly in Mozilla.
Can some one suggest a better way to track such inconsistent JS errors?
thanks

You're dereferencing a variable which is undefined, but without an example, hard to say much beyond that.
(everything is an object in javascript so it's pretty much the only way to generate that error)

In Internet options in Advanced tab you can enable debugging.

IE has a lot of quirks that won't arise in other browsers. The best way to debug IE is to get a copy of Microsoft's Script Debugger, and you can launch it from IE to get a clearer idea of where the actual problem is. Script Debugger will halt execution at the problem line and show it in a separate window (IE locks up until you close Script Debugger, but you get a much better idea of what line is causing the problem).
See here for more: http://www.codestore.net/store.nsf/unid/DOMT-5UBUVW?OpenDocument
There's a link in the middle of that document that goes to MS Script Debugger, but here it is anyway.

Related

Firebug causes Firefox to be unresponsive

I'm a beginner web developer. I often use Firebug to debug my JavaScript.
Problem is that there are some script files from my page's UI that have a lot of code and this causes my web browser to be unresponsive, i.e. I get a dialog saying the script is unresponsive. Basically this happens when I am within Firebug's Script panel.
How can I deal with this?
I tried finding solution to this problem and nothing.
As for the answer I think the best was posted by #Pablo(can't assign answer to comment unfortunately) and it is simply trying out Google Chrome console. None of the problems I mentioned exists here.
Cheers guys!
I have had the same problem debugging some of our older scripts that make extensive use of the eval() function.
This causes many scripts to be displayed within the Script Location Menu. (Each dynamically generated script is represented there.)
A possible solution, given that it was caused by the number of files in my instance, might be to see if you can bypass the problem entirely by utilizing fewer source files for the same code. Using a 'built' version of whatever frameworks you use might alleviate the problem. (Particularly if they still are debug-able in a built form.)
If that does not work, you might try debugging using Firefox' built-in debugger (available via Ctrl+Shift+S. (Or switch to another browser to do the debugging, but that is obviously a far less desirable solution.)

Chrome insists on keeping stale/old javascript code and won't reload the recent version

I'm doing some very simple web dev and using chrome's debugger. The included javascript never seems to update when I modify the source. I can delete the contents of the whole file and it still loads stale code (unless I restart chrome). If I remove permissions on the file, it notices and won't load the page but when replacing permissions the old code is back. This happens both when fetching via http and the local file directly. No amount of spamming reload or ctrl-F5 works. I've tried clearing and manually deleting the cache and even setting the don't cache option in the developer options. I don't think chrome's in local modifications mode but I can never tell (this "feature" is amazingly buggy if not sometimes quite desirable). I don't have this issue in firefox but specifically want to test chrome at the moment.
Has anyone seen this before? What are the common causes? What can I do to prevent this happening?
I'm running fedora 18 with google-chrome 31.0.1650.39-1 - and after noting a newer version - 32.0.1700.19-1. Both have the same issue.
I think ctl-shift-r does a "hard reload," ignoring any cache.
I normally get this problem with Dreamweaver, the new code refreshes fine in the dreamweaver window but when I wanna test on chrome it loads the old code. It generally just takes a couple refreshes for the code to catch up - I assumed the problem was because I was running the files off an appache server which could be causing the delay however it's still local

liferay javascript IE8

Currently working on liferay site and stuck with IE8 browser issue. When I loading the page I am getting the Javascript errors.
'undefined' is null or not an object dojo.xd.js line 14 character 31332
When I load the same page in Chrome and Firefox and I didn't see any java script errors.
For IE I could not able to proceed much as it is taking to dojo source file and could not able to figure it. I also tried to remove dojo components one after another to see the whether I can isolate the issue. But it doesn't help and getting the same error. Is there any better way to debug this issue/ any other tools that will help on get more information/ suggestions?
Is there any data transmission between browser and server. If so, paste here or check for correct JSON format. Extra commas, braces are usually the culprit.
Firefox and Chrome are relaxing browser and adjust themselves.

Getting very strange javascript error and this page also refuses to work in Internet Explorer 7 or 8

This is the page I'm working on... http://schnell.dreamhosters.com/folio/earthquake.html
Its purpose is explained via the instructions on the left. I'm finding that after doing so many searches and clicking so many of the links in the list on the right that the page freezes up, the Google Map stops working and Firebug tells me of an error in main.js and it goes like this...
b is undefined
Line 49
I really don't know why this decided to happen all of a sudden and the error is so cryptic and muddled amongst Google's code that I don't think I'll be able to figure this one out by myself.
Another problem I'm finding is that the page itself simply refuses to work in IE7 and IE8 (or probably any version of IE for that matter). I am also at a loss as to how to solve this problem because I can't figure out how to use any of IE's debuggers (if they even have one) and seeing how I already tested this and made it work in two browsers (technically three since Safari runs off WebKit just like Chrome), I just don't have the drive or capacity to imagine what could be going wrong.
Any help would be greatly appreciated
Moved from comment to answer.
As scunliffe mentioned, you are trying to do a crossbrowser AJAX without using jsonp. Use either $.ajax() with datatype jsonp or add a &callback=? at the end of the URL in the $.getJSON() call.
IE8 is quite good when it comes to helping out the developer. From memory F12 will open up the developer window where you can inspect the DOM, CSS and debug script.
Your error is cryptic because most javascript comes minified, so variables are all remapped to single letters, etc. See if the script causing the problem has a development (i.e. unminified) version as this will make a lot more sense to step through.
With regards to your specific issue it sounds like a timing issue. While browsers do a decent job of executing script in a consistent way if you follow standards, they do differ in their timings i.e. when things execute. That would explain why b is undefined in some cases and not others.

IE7 Crashing on some machines, errors in Debug bar, but don't see 'showstopper'

I've recently been made aware that my site is crashing in IE7. I tested it on a bunch of machines myself, but of course it always runs perfectly.
My brother just showed me IE7 on his computer, and it definitely crashes.
I've got 'debugbar' running, and it shows some errors in the HTMLCheck, and is warning that fb:login-button is not recognized (but of course it is allowed).
I run javascript check and it says
Script Error:
//----------------
Line: 1
Character: 6
Code: 0
Error Message: Syntax error
I can't actually see any script error myself.
The link is http://HearWhere.com
If somebody could help me figure out why this is failing on 15% or so of IE users, I'd be very very greatful.
Pete
Definitely does crash IE7 on a virtual machine I have. It's worth doing a bit of an audit for a start - for example, you're including and calling the Google Analytics JS twice, which is probably screwing up your stats if nothing else.
I've had crashes related to jQuery in IE7 before, all of which I could put down to large jQuery loops. Have a look through your code and comment parts where you are looping over the results of a jQuery select that could have a large number of results, or times when you are inserting a large number of elements into the DOM.
There's no Javascript errors (according to FireBug), but a large number of errors in the CSS for that page, any one of which could be antagonising IE7.
IE8 has a really nice javascript debugger, but it doesn't crash in IE8 for me. Previously I used Microsoft Script Editor for debuggin in IE 6 & 7. For some strange reason it's bundled with Microsoft Office! It's a bit hassle to setup, but it works.
http://www.jonathanboutelle.com/mt/archives/2006/01/howto_debug_jav.html
If you are crashing, the JS code is not a likely cause. You need to look at isolating the specific OS, IE version number, patch level, and external dependencies (versions of flash, etc).

Categories