Issue getting tinyMCE spellchecker plugin to work with IE6 - javascript

Let me start off by saying I realize that this is a long shot. I've spent about 7 hours on this already making zero progress or finding any leads. Debugging in IE6 is no fun.
I have implemented the tineMCE editor spellcheck pluging using ASP.NET, following instructions on this page: http://www.kelvinluck.com/2009/01/using-spell-checker-for-tinymce-with-net-on-iis/
Everything works in IE8, Firefox, Chrome, etc
IE6, however, hangs up once the spell check button is pressed (only when spelling errors are found).
At this point it just spins the ajax indicator forever.
I have used fiddler to compare the ajax calls with the ie8 version which is working great. There is no difference in the POST or the response. It generates the response with all the bad words identified in both versions.
I have used debugBar to check for errors, what I get is "Invalid Argument", but the line number is always different and in the high millions, typically, which is very weird (this might be because I'm using IE Tester).
I realize this is the kind of question nobody likes, but I'm pretty much out of options, and I need to get this to work in IE6, as this is what our client regretfully uses. I'd be very interested in hearing about some potential debugging methods for IE6 or details regarding tinyMCE's spellchecker plugin.

The Microsoft Script Debugger is much more reliable than IETester. Here's some tips to work with it:
If you get an error alert, view source and copy it to a text editor. Find the line number and look before and after it for a syntax errror, such as a hanging comma, missing semicolon, or missing parentheses.
To prevent breaking on an error, unset the Break on Error toggle button or press Ctrl+Shift+E.
If you want execution to pause at that breakpoint only when a certain condition is true, then set a condition for that breakpoint. To set a breakpoint Condition, right-click on the breakpoint, select the Condition... option, enter the condition and click OK
Use Fiddler for troubleshooting network response issues, and the JScript Error Reference to help identify the specific error message.

Related

IE9 says Syntax Error but not where?

So, I have a large project with a bunch of javascript stuff going on.
Now I did some testing with IE9 and on one event triggered AJAX-operation it aborts and tells me
Syntax Error: Expected ')'
but that's all it says. It leaves me without any clue about where to start looking.
I'm using Dojo for most of the things I do and at this particular point I'm retrieving JSON-data with the AJAX-request. But I've ruled out an error in the JSON-string, simply because JSON ususally does not contain brackets (), right?
There also is a console.log(data) right after the request should be completed, but it doesn't fire either. And I don't see any fancy bracketwork before that, that could make IE lose it's mind. But I might still be looking at the wrong spot, just trying to give as much info as possible here.
(btw: Firefox is fine with everything. No errors or warnings; everything runs just fine)
What's the best way to debug this or possible causes?
Versions of Internet Explorer from 8 upwards have a built in debugger which is similar to Firebug - press F12 to launch it (by default).
The standard error reporting is terrible, but the debugger will give you much more accurate feedback on where the error occurred.
(My take on this is that the standard Javascript error handling assumes you're a typical IE user and gives you very little feedback. Firing up the dev tools lets it know you can handle the truth.)
It was the response from AJAX after all.
IE had problems sending all the GET parameters resulting in an error message being mixed with the JSON code. I still don't understand why it expected a ) but fixing the response fixed the issue.

How to check the number of Javascript statements run?

IE8 is giving me the not-uncommon "A script on this page is causing your browser to run slowly" warning. Of course this only happens in IE and not in any other browser. I am using an Infragistics jQuery grid control that seems to be causing the warning.
On doing a little bit of research I learnt that while nearly every other browser displays the warning based on execution time (generally 5 or 10 secs), IE does it based on number of statements processed (5 million statements).
I want to be sure it is the grid control and not something else. Is there a way I can see the number of statements processed, maybe using something like Firebug or the IE developer tools?
IE8 has a profiler built in and it seems like no one knows it exists. IEBlog had a nice article explaining the profiler's features when IE8 was in BETA.
If you are using IE8 hit the F12 key and you will get a javascript debugger, step through the code and find the issue.
Firebug or chrome dev tools, you can see the timeline of execution.

Why some javascript error only comes in IE not in firefox? how to know where is code creating problem?

Why some javascript error only comes in IE not in firefox? should i solve all IE javascript errors, if my site is working fine with it ?
You should definitely seek to fix any JS errors you are getting in IE. What shows up in your IE as a little yellow icon, will show up in other IE browsers as a popup letting the user know there was an error.
One way you can minimize problems is by using one of the many JavaScript framework/libraries like jQuery, MooTools, etc that seek to minimize browser differences. Then, when you get specific errors, they can often be fixed by added a missing ; or adding an if statement in the correct place.
You should never knowingly leave code unfixed that is known to break in modern browsers.
should i solve all IE javascript
errors, if my site is working fine
with it ?
I'd say, yes absolutely. Under certain circumstances, IE throws Javascript errors right into the user's face with a big fat dialog. I think it's very embarrassing for a visitor (who may not even know what JS is, and even less the intricacies of cross-browser scripting) to get a error message as their first impression of you.
they have slightly different implementations of javascript, dom, css, etc.... should you fix the errors? if no major functionality is impacted, then it would probably be a very low priority... and depending on your userbase (say its a corporate intranet) you could simply say Firefox is your preferred browser. all depends on the requirements. Prioritizing tasks will help ensure the most important objectives are met.
Yes, you should fix the Javascript errors being reported in IE, because it can be unclear how the errors manifest themselves in your application. For instance, it can cause menu navigation to not work, or incorrect behavior of buttons.
As for actually detecting where the problem came from and how to fix it, you can try our Browsera service, which will detect and log the Javascript errors for you that occur in the browser, and use the Script Editor, which comes with MS Office
Or, if you dont have OFfice, use the free Microsoft Script Debugger, which works, but is less powerful.
if you are working with ajax than you can use $.getJason using jQuery, instead you get data from ajax and then use JSON.parse();

Is there a way to get more detailled JS error messages in IE7?

When there is a JS error in IE7, the text displayed is not helpful mainly because it says "error at line X" but the line doesn't really correspond to anything if you start including multiple javascript files.
Is there an option or add-on that could maybe improve this?
I haven't found anything in IE7. However, if you have the option, IE8 + web developer toolbar makes it a lot easier, as the web dev toolbar includes a javascript debugger. Most of the time I see the same errors in IE 7 and 8, so debugging them in 8 usually leads to fixing it in 7 as well.
The only extra detail you can get is by turning on the script debugging. You can do this through Internet Options - Advanced - uncheck Disable Script Debugging (Internet Explorer). This will pop up an alert whenever you get an error and you can see the line of code that created it as well as step through the code's execution.
All that I have found helpful is turning on the debugging. You can then sometimes step through the code to the problem. It seems to be hit or miss though, as to whether it actually works or not.

IE and unspecified error and in IE8 object doesn't support method

I have a big (probably) javascript problem.
i have a long and complex script on the page based on mootools framework,
in FF and other browser everything works fine, but in ie 6 and 7 i got "error:153 (sometimes 84) Unspecified error" and the strange thing is in IE8 that show me the error "Object doesn't support this property or method".
someone know the possible cause of the problem? o maybe someone know a list of IE's unsupported property or method?
In IE8 you can get the line number of the error, then right-click -> view source. IE8 has a proper source, which includes script lines, so you should quickly be able to find the source of your error.
If the script you're using isn't obfuscated or all on one line, you could use the JavaScript debugger in IE8 to pinpoint the object which is causing the error. Press F12 to open the Developer Tools, go to the Script tab, and click the "Start Debugging" option. If there's an error it may well break on the relevant line. If not you can set some breakpoints and step through the code.
You can also use IE8 developer tools http://blogs.msdn.com/ie/archive/2008/09/03/developer-tools-in-internet-explorer-8-beta-2.aspx to debug.
For other version I suggest you use Web developer tool bar which is similar to web developer tool bar for firefox.
Its near impossible to tell what the problem is with this information (at least for me).
For IE6/7 I suggest adding a few alerts to the javascript in intervals to find out exactly what line of code is causing your problem. If you know which object is causing the error, it is usually quite simple to find out what the exact problem is.
IE8 provides nice debugging tools, so that is a good place to start.
In my case the error was due to a $ mapping conflict.
Using jQuery instead of $ solved the issue.

Categories

Resources