Javascript in IE6

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lüpher Cypher

    #1

    Javascript in IE6

    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="javas cript">
    </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
  • David Dorward

    #2
    Re: Javascript in IE6

    Lüpher Cypher wrote:
    [color=blue]
    > 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.[/color]

    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

    Comment

    • Lüpher Cypher

      #3
      Re: Javascript in IE6

      >[color=blue]
      > So that any user agent which can not or will not deal with JavaScript (like,
      > say, GoogleBot) will see no menu at all?[/color]

      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.
      [color=blue]
      >
      > 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.
      >[/color]

      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

      Comment

      • Fred Oz

        #4
        Re: Javascript in IE6

        Lüpher Cypher wrote:
        [...][color=blue]
        > 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! ;<>[/color]

        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

        Comment

        • Duncan Booth

          #5
          Re: Javascript in IE6

          Lüpher Cypher wrote:
          [color=blue]
          > Anyways, this simple page creates the same problem:
          >
          ><html>
          ><body>
          ><script language="javas cript">
          ></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? :)
          >[/color]

          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.


          Comment

          • David Dorward

            #6
            Re: Javascript in IE6

            Lüpher Cypher wrote:

            [color=blue]
            > 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.[/color]

            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).
            [color=blue]
            > 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[/color]

            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">ite m</a> </li>
            <li> <a href="item">ite m</a> </li>
            <li> <a href="item">ite m</a> </li>
            <li> <a href="item">ite m</a>
            <ul>
            <li> <a href="item">sub item</a> </li>
            <li> <a href="item">sub item</a> </li>
            <li> <a href="item">sub item</a> </li>
            </ul>
            </li>

            .... is pretty simple.
            [color=blue]
            > , 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[/color]

            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::Toolk it)
            [color=blue]
            > and they will have to train people to use it,[/color]

            "Double click this icon after making changes to the website"
            [color=blue]
            > whereas I figure they already know how to use dreamweaver (I was told
            > that's what they will use).[/color]

            Doesn't Dreamweaver do templating anyway?
            [color=blue]
            > 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 :)[/color]

            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

            Comment

            • Mark Preston

              #7
              Re: Javascript in IE6

              Fred Oz wrote:
              [color=blue]
              > 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.
              >[/color]
              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?

              Comment

              Working...