PDA

View Full Version : Problem with IE 7 and Javascript



Rockonmetal
09-07-2007, 09:46 PM
IE 7 is not displaying any javascript... though firefox is... it is very annoying because I have to finish something and i don't like using firefox, please, how do i re-enable javascript with IE 7?

Please i need this solved very soon or i'm totally screwed.

jscheuer1
09-08-2007, 02:50 AM
Resetting to the defaults in the security tab would most likely take care of that. To be more specific, though other things might take precedence:

Tools > Internet Options > Security > Custom Level

scroll to near the bottom and make sure that:

Scripting > Active Scripting

is enabled.

Rockonmetal
09-08-2007, 02:53 AM
k thnx

Twey
09-08-2007, 03:04 AM
You'd have much better luck debugging with Firefox, though... IE's error console is notoriously useless. I use Konqueror primarily, but I still debug complex scripts with Firefox purely because its error messages are more informative than those of any other browser I've used.

jscheuer1
09-10-2007, 04:26 AM
I have to go with Twey on the issue of debugging scripts. At the same time, if your goal is mainly to get scripts recognised in IE, I'm certain that I haven't steered you in the wrong direction.

I would like to add that IE's error reporting is not as useless as Twey makes out, but it is by far inferior to FF's.

Twey
09-10-2007, 04:46 AM
I would like to add that IE's error reporting is not as useless as Twey makes outThe only two JScript error messages I have ever seen it give (or at least remember it giving; admittedly I haven't used it seriously in a fairly long time) are "object expected" (which it uses for practically everything) and "unknown runtime error" (which it uses for everything else). On top of this, it rarely actually points to the right line, and it's quite common to find that the position to which it is pointing is several hundred lines away from the actual source of the error, in a different file. In my experience, the dialogue box offers no more real information than the little yellow warning triangle in the status bar.

jscheuer1
09-10-2007, 05:09 AM
The only two JScript error messages I have ever seen it (sic IE) give . . .

This probably will be of use to others, but right now (in this post of mine) it is just you and I talking, comparing notes, as it were. I would never say that IE's error reporting is better than that of the Fire Fox browser's. However, it does often give line numbers, and if the script is on the page, those numbers are as accurate (+-1) as FF's. If the script is external, they are also as accurate - for that external script's line numbers.

Admittedly, this is something that is hard to get used to, comes with experience. But when the error is specific to IE, and it is IE that you are trying to debug, it is an invaluable aid.

Twey
09-10-2007, 05:14 AM
If the script is external, they are also as accurate - for that external script's line numbers.No, I sat down and worked this one out -- the line is that in the generated code. Generated code, as seen by IE, means (usually) code with all remote <script> elements replaced with the literal content of their file.
But when the error is specific to IE and it is IE that you are trying to debug, it is an invaluable aid.Microsoft Visual Studio includes a debugger for IE that is far more useful.

jscheuer1
09-10-2007, 05:21 AM
No, I sat down and worked this one out -- the line is that in the generated code.

That hasn't been my experience. It is the line number in whatever file the error occurs. But by even pursuing this avenue, you are admitting that:


The only two JScript error messages I have ever seen it give (or at least remember it giving;

was a bit overstated. Trust me, I have no reason to lie about this. IE's error reporting is useful if you get used to it. And it isn't nearly so clear or so helpful as is FF's.

Twey
09-10-2007, 05:58 AM
Er, was that a misquote? I don't see what relevance that quote bears.

It is at least very close to useless, since I'm a) not going to sit down and work that out when I can more easily and accurately find the problem with strategic log calls in the code, and b) entirely certain that that's all of the case. There have been exceptions where I simply can't work out what's accounting for the extra/missing lines.

jscheuer1
09-10-2007, 06:21 AM
Er, was that a misquote? I don't see what relevance that quote bears.

To each their own, but no.

Don't confuse the fact that IE's error reporting is less than desirable (which FF's is also, simply nowhere near as bad as IE's) with the erroneous notion that either are useless.

Twey
09-10-2007, 06:58 AM
To each their own, but no.Well, one minute we were talking about how accurate IE's line numbers were, then you were saying that by my discussing this I must have seen an error other than "object expected" or "unknown runtime error." "Object expected" has line numbers too, you know.
Don't confuse the fact that IE's error reporting is less than desirable (which FF's is also, simply nowhere near as bad as IE's) with the erroneous notion that either are useless.Well, certainly not entirely useless: just reporting that there has been an error is some use.

jscheuer1
09-10-2007, 08:22 AM
Well, one minute we were talking about how accurate IE's line numbers were, then you were saying that by my discussing this I must have seen an error other than "object expected" or "unknown runtime error." "Object expected" has line numbers too, you know.Well, certainly not entirely useless: just reporting that there has been an error is some use.

We are dancing around this topic, or at least I am. But this is the first that I see much credence given by you to the fact that line numbers are often issued in IE's error reporting. Let's get more concrete.

It's true that sometimes IE's error reporting gives a totally erroneous or no line number. In FF, in my experience, the situation is similar, though the overall process is superior.

In FF, when line numbers are given (they aren't always) are accurate within +-1. In IE the line numbers are (given the proviso that they may indicate a line number actually in an external file, rather than in the file mentioned in the error) are usually the same (+-1), except that sometimes they are truly indecipherable, as far as I can tell, yet even then, sometimes moving all scripts onto the page, if any are external, will elucidate the matter.

Let's zoom in a little. The line number in IE, if given, is more often than not accurate (+-1) when it is for a real line in a script. If the script is external, it will usually be accurate for that file, even though the filename given will be for the page that the script is called from.

Now, this +-1 I've been mentioning is really the line itself or +1. That is due (when it happens that way in either browser) to the error actually occurring on the previous line, but only being caught by the script parser on the next line because that is the line that, technically speaking, exhibits the error.

Oddly enough, I think you are still with me. The major difference is that in IE, the overall accuracy of error reporting is inferior to that in FF. However, in FF it isn't always as clear as it could be. Opera is sometimes better than either, sometimes worse than both, sometimes roughly equivalent. Opera does a better job (only sometimes) by telling you what thread the error is in. This is especially helpful if the error is in a timeout/interval and/or is from a hard coded (and sometimes even when its from an added/attached) element event. Opera gets bad marks from me because it numbers lines from the opening script tag, making it harder to find using an editor with line numbers, but good marks because that is what allows it to thread javascript calls that aren't technically tied to any line number.

None of this changes the fact that, if the error only happens in IE, or if by chance the other browsers just don't see it, IE's error report can sometimes be the 'manna from heaven' that solves the issue. This even, on rare occasion, happens when other browsers just won't run the script, while at the same time report no error.

Conversely, it can happen that you can find an error that only IE has an operational problem with as regards a particular script in another browser's error report. Let me elucidate. Other browsers run the script fine, but IE does not. But IE reports no error. If you look carefully at the console in either FF or in Opera you may find the reason for IE's problem.

When all else fails, in any modern browser, you can usually isolate the error with temporary try catch statements.

I've tried to be as thorough as possible, but may have missed some things of importance. If you simply run three or four browsers at a time in a multitasking environment though, it is unlikely that you will miss much.

Twey
09-10-2007, 08:32 AM
In FF, in my experience, the situation is similarReally? I've never experienced this, except in anonymous functions that are executed outside the normal flow of the script.
When all else fails, in any modern browser, you can usually isolate the error with temporary try catch statements.Or well-placed logging of info.

jscheuer1
09-10-2007, 08:57 AM
In FF, in my experience, the situation is similar

Really? I've never experienced this, except in anonymous functions that are executed outside the normal flow of the script.


When all else fails, in any modern browser, you can usually isolate the error with temporary try catch statements.

Or well-placed logging of info.

To the first case, that is almost always the cause in IE as well. Once you get used to IE's habit of not mentioning the source filename if it is an external one, you will see this to be true. The only major exception being when IE gets confused between strings and objects due to its penchant for assuming the document.all collection at what could be considered inopportune moments.

To the second case, there are at least 3 ways to debug via 'brute force'. I only mentioned the most universally applicable method I am familiar with, as the discussion was here to fore about error reporting available in various browsers.

ontheweb
09-19-2007, 06:06 PM
Resetting to the defaults in the security tab would most likely take care of that. To be more specific, though other things might take precedence:

Tools > Internet Options > Security > Custom Level

scroll to near the bottom and make sure that:

Scripting > Active Scripting

is enabled.

..................

Hello,
I am new to this forum, but have used the "Fade-in image slideshow- By Dynamic Drive" for quite a few of the web sites that I have designed.

Even after enabling Active Scripting as instructed above, I still have clients that are not seeing their web site as it should show up with the fade in slideshow.

I have not upgraded to IE7 and still use IE6 and the javascript is working fine.

Does anyone have something else that we can try?
Thank you so much for any help!

Rockonmetal
09-19-2007, 06:17 PM
I am using firefox for now because idk what everyone says but IFRAMES do work in them...

Wow i forgot about this thread i posted... BTW I don't get any please activate this script or anything like that... but i'm fine with using firefox...