Forum Moderators: open
The javascript file won't be called if the user has javascript disabled - which is the case for about 10% of users. Also, search bots such as Googlebot won't call it as they don't look at javascript.
As for CSS, it is rarely disabled in the end-user's browser, so it will be called in most cases (except for the bots again).
Use:
<script type="text/javascript" src="myjspage.js"></script>
for javascript, or
<link rel="stylesheet" type="text/css" href="mystyles.css">
for CSS.
The issue is whether the browser actually understands javascript in the first place, and if it does, whether that feature is still enabled, or whether it has been disabled by the user.
For javascript-enabled browsers it does not matter whether the code is inside the HTML file, or is in an external .js file. The code will be treated the same way.
External javascript files make for a neater HTML page, allow code re-use across the entire site, and easier updating of the code. External javascript is the way to go.
When using IE5+, I notice quite often that an external stylesheet or script file isn't imported, often with
catastrophic consequences...
Yes, there's a bug there and I can't pin it down. I heard others mention it, but never saw it myself until a recent rebuild of this machine.
Now, even after trying three different builds of IE6, I am still stuck with it.
It's got to be relatively rare - some combination of browser plus OS plus other software of something like that. Else we'd have heard a loud complaint long ago.
I agree. I often it see with my own browser/OS setup it on a VERY high traffic site of ours, but I haven't heard of any complaints through customer services...
However, still fairly worrying. Even if it affects only 1% of users, that can work out to be a lot of users that may hit the back button.
I'd love to hear of a solution, but I can't believe that it would involve anything other than a reinstall of user software, which is sadly beyond our control.
I'm wondering if it's anything to do with some kind of scumware? i.e. something that interacts with the browser itself.
I've tried strenuously to avoid getting scumware on my box, but while I was away a while ago I think somebody else may have inadvertently installed some...
Be aware that it can give false alarms. A program that I use to plot the paths of Comets through the Solar System, installed as something like C:\Program Files\Comet\comet.exe was incorrectly identified as being a component part of Comet Cursor for example.
No. Although netscape supported JavaScript (SCRIPT element) from version 2.0Beta3, SRC attribute was supported from version 3.0Beta3.
Incidentally, IE supported the SCRIPT element from version 3.0Beta1, and also supported the SRC attribute from version 3.02.
anything to do with some kind of scumware?
Like those new RealOne message pop-ups I just started seeing, maybe? I've been looking for candidates in the most recent stuff, because I never saw the bug until the last few months. That obnoxiously invasive RealOne Player is high on my suspect list right now.