By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,964 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,964 IT Pros & Developers. It's quick & easy.

Javascript in IE6

P: n/a
Hi,
I'm developing a site for a department in my college. Their server has
no server-side scripting and thus I'm forced to use JS. As the
department have many pages with the same look-and-feel, I've decided
that I'll use HTML template to have the page look the same and JS to fix
the menu so that one wouldn't have to update all the pages if something
was deleted, added or modified. Anyways, FireFox takes it well, and so
does NS, but IE6 comlains that the page may modify data on the computer.
Anyways, this simple page creates the same problem:

<html>
<body>
<script language="javascript">
</script>
</body>
</html>

So, I figure that as long as IE(6) encounters a <script> tag, it starts
complaining (taking into account the security settings), which seems
rather dumb. So, I was wondering if there is a work-around.
Anyone? :)

Thanks,
Lüph
Jul 23 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Lüpher Cypher wrote:
I'm developing a site for a department in my college. Their server has
no server-side scripting and thus I'm forced to use JS. As the
department have many pages with the same look-and-feel, I've decided
that I'll use HTML template to have the page look the same and JS to fix
the menu so that one wouldn't have to update all the pages if something
was deleted, added or modified.


So that any user agent which can not or will not deal with JavaScript (like,
say, GoogleBot) will see no menu at all?

The best option for including content in multiple pages is some form of HTML
Preprocessor. This will do the same job as a server side script, but is run
on the development machine and outputs static documents which can be
uploaded to the webserver.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2

P: n/a
>
So that any user agent which can not or will not deal with JavaScript (like,
say, GoogleBot) will see no menu at all?
Well, if I simply do the html template, and then 20 pages, imagine what
it's going to take to modify something general on the site. Also, see below.

The best option for including content in multiple pages is some form of HTML
Preprocessor. This will do the same job as a server side script, but is run
on the development machine and outputs static documents which can be
uploaded to the webserver.


The problem here also is that I'm simply developing the site (I'm a
work-study), and after I'm gone people, who are not exactly involved
with web programming, are going to maintain it. If I left them with html
code that needs to be modified every time something is going to be
changed, it would create more headache for them, then it is now - now
they can simply modify anything by adding/deleting/modifting a
definition of a function call in a separate JS file, and then using
dreamweaver to modify content. If it was me who would've been doing that
and I had a hosting account, I would've gone with server-side script :)
As for the preprocessors, I'm not so sure they would go with that - it
probably costs and they will have to train people to use it, whereas I
figure they already know how to use dreamweaver (I was told that's what
they will use). So.. The question remains.. :) Besides, from my point of
view, very small number of people don't have JS, and a some more have it
disabled, and rather much more have the browser prompt them :)
It just kind of pisses me off, because there are no statements that can
be hardful in the script, and IE should really look for those that can
be. I mean, if I change the .innerHTML property/etc that's not going to
do anything harmful. And - it does show the message even if it's an
*empty* script tag! ;<>

Lüph
Jul 23 '05 #3

P: n/a
Lüpher Cypher wrote:
[...]
disabled, and rather much more have the browser prompt them :)
It just kind of pisses me off, because there are no statements that can
be hardful in the script, and IE should really look for those that can
be. I mean, if I change the .innerHTML property/etc that's not going to
do anything harmful. And - it does show the message even if it's an
*empty* script tag! ;<>


MS in their wisdom allow access to far more platform capability
than JavaScript alone provides. I guess rather than just have
JSscript access to HTA or ActiveX objects complaining (i.e.
things that are Microsoft's invention and can do actual harm to
a PC), they decided to make IE complain about all scripts.

Simple solution: don't use IE. If users complain about their
browser complaining, tell them that it is an IE thing and that
they should use a different browser.
--
Fred
Jul 23 '05 #4

P: n/a
Lüpher Cypher wrote:
Anyways, this simple page creates the same problem:

<html>
<body>
<script language="javascript">
</script>
</body>
</html>

So, I figure that as long as IE(6) encounters a <script> tag, it starts
complaining (taking into account the security settings), which seems
rather dumb. So, I was wondering if there is a work-around.
Anyone? :)


I guess that you are loading the page from a file on your local disc. If
you load it from a webserver then IE6 will stop complaining.

If you want to suppress the warning, then add the line:
<!-- saved from url=(0013)about:internet -->
just after the <html> tag. This will cause the page to be loaded in the
internet security context instead of the more restricted local machine, but
it really is simpler just to run a local webserver and use that instead.
Jul 23 '05 #5

P: n/a
Lüpher Cypher wrote:

The problem here also is that I'm simply developing the site (I'm a
work-study), and after I'm gone people, who are not exactly involved
with web programming, are going to maintain it.
That usually calls for a fairly powerful content management system with very
strong limits on what users can write. (That or allowing them to produce
horrific markup).
If I left them with html
code that needs to be modified every time something is going to be
changed, it would create more headache for them, then it is now - now
they can simply modify anything by adding/deleting/modifting a
definition of a function call in a separate JS file
Changing a function call is simpler then editing a little bit of markup?
Well you could take the preprocessor a step futher and have it parse a
simple data format that describes the menu structure.

Although I think that:

<ul>
<li> <a href="item">item</a> </li>
<li> <a href="item">item</a> </li>
<li> <a href="item">item</a> </li>
<li> <a href="item">item</a>
<ul>
<li> <a href="item">subitem</a> </li>
<li> <a href="item">subitem</a> </li>
<li> <a href="item">subitem</a> </li>
</ul>
</li>

.... is pretty simple.
, and then using
dreamweaver to modify content. If it was me who would've been doing that
and I had a hosting account, I would've gone with server-side script :)
As for the preprocessors, I'm not so sure they would go with that - it
probably costs
That depends on the functionality you need from it. If you are just dumping
content into a template its trivial. I could write one in five minutes
using Free software (i.e. no prewritten libraries that you can't find on
the Internet for free). (Perl, File::Find, Template::Toolkit)
and they will have to train people to use it,
"Double click this icon after making changes to the website"
whereas I figure they already know how to use dreamweaver (I was told
that's what they will use).
Doesn't Dreamweaver do templating anyway?
So.. The question remains.. :) Besides, from my point of
view, very small number of people don't have JS, and a some more have it
disabled, and rather much more have the browser prompt them :)


About 15% according to some accounts. Rule 1 of JavaScript is to write
scripts that enhance an otherwise perfectly acceptable page.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #6

P: n/a
Fred Oz wrote:
Simple solution: don't use IE. If users complain about their browser
complaining, tell them that it is an IE thing and that they should
use a different browser.

Yes, it is the simple solution and - lets be honest - it is the solution
that the main security organisations are advising. But let's stick with
the real world for a moment and admit that eight out of ten people still
use it and are likely to carry on doing so, shall we?
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.