Some unknown browsers fail to calculate my JavaScript code.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cardman

    #31
    Re: Some unknown browsers fail to calculate my JavaScript code.

    On Mon, 02 Feb 2004 15:21:03 GMT, Michael Winter
    <M.Winter@bluey onder.co.invali d> wrote:
    [color=blue]
    >On Mon, 02 Feb 2004 14:54:53 +0000, Cardman <do-not@spam-me.com> wrote:
    >[color=green]
    >> Er, wrong.[/color]
    >
    >Yes, I am. I didn't consider the fact that looping code will, in all
    >likelihood, be smaller than the several HTML elements it produces. My only
    >defense is that I'm in the middle of re-writing your front page, so I have
    >my mind on other things. :)[/color]

    No problem, when I do actually think about what such changes will do
    before starting on the coding.

    And I will certainly look forwards to seeing your results, where I can
    only wonder if you are aware of all the factors. I will find out when
    you complete it I guess.
    [color=blue][color=green]
    >> Ideas on how to transfer my long list of Ordering Codes just once
    >> instead of 12 times would be welcome.[/color]
    >
    >...which is probably why the typical shopping basket method is a good
    >idea. By limiting the total number of items displayed to those in a
    >particular catagory, you don't have to transfer as much data.[/color]

    True, but moving a shopping basket feature into my site has always
    been a daunting task, which is mostly why I don't have one yet. If I
    make it myself, then it will take tons of time and effort.

    Should I simply include a popular plug-in system, then that would also
    take up a lot of time and effort. Not to forget that it is unlikely to
    do what I really want, like supporting all my 21 different payment
    methods.
    [color=blue]
    >Once the
    >user finalises the order, once again the total data is limited but this
    >time, it is to the items ordered.[/color]

    Yes, but my current system is an all-in-one thing, where rebuilding
    the whole system from scratch has as much appeal as jumping off a
    building.

    Sure a new system, working as I desire, would be a major improvement,
    but getting from A to B is no easy trip.
    [color=blue]
    >There's no way to reduce the load if all stocked items are present at
    >once, unless you use JavaScript (which we're trying to avoid, if possible).[/color]

    I see, which may make a good reason to leave it under JavaScript
    control, but I will give the PHP code a spin first.
    [color=blue]
    >Sorry again for my mistake.[/color]

    No problem.

    Cardman


    Comment

    • Cardman

      #32
      Re: Some unknown browsers fail to calculate my JavaScript code.

      On Mon, 2 Feb 2004 15:25:47 -0000, "Richard Cornford"
      <Richard@litote s.demon.co.uk> wrote:
      [color=blue]
      >The argument that says that what works on some large percentage of
      >browsers must be the right thing to do is the argument used for writing
      >IE only code. So not really part of the techniques for cross-browser
      >scripting.[/color]

      It works on Netscape and the other browsers that I have tried as well,
      but as mentioned that problem is now fixed.
      [color=blue][color=green]
      >>As I have always kept an eye on the size of my files, when
      >>people with a slow modem would spend about half a minute
      >>downloading my Order Form as it is.[/color]
      >
      >As it stands 3/4 of the order form file is JavaScript, which in
      >principal could be in a separate JS file and maybe not need to be
      >downloaded more than once.[/color]

      I do not see that this idea would help much, when it may introduce
      other issues if these files are cached.
      [color=blue]
      >And, even as modified, the script remains
      >repetitive and could be further reduced in size.[/color]

      It is a lot better than what it was, where it would be difficult to
      improve it further. The CheckBulk() function I can improve by removing
      most ifs by adding an array. The LastCard error checking section I
      plan to improve anyway, there are sections near the end of the
      ShowInfo() function that I can now improve, but that is just about it.
      [color=blue]
      >The HTML contains a
      >great deal of presentational mark-up which could be done with CSS,[/color]

      Well since I have never heard of CSS until visiting this group, then
      that explains why I did not use it. Also I would have to make sure
      that my HTML editor likes the code.
      [color=blue]
      >also in an external file that may not need downloading more than once.[/color]

      My text does not repeat that badly.
      [color=blue]
      >Consider your:-
      >
      ><BIG><BIG><BIG >PURCHASE ORDER</BIG></BIG></BIG>
      >
      >- as opposed to:-
      >
      ><H1>PURCHASE ORDER</H1>
      >
      >- with the CSS to give the same presentation. Half the size and a better
      >semantic description of the content.[/color]

      I will assume that CSS is supported by mostly all browsers.
      [color=blue][color=green]
      >>Then that should remind you that most experts cannot know
      >>everything, which was obviously unhelpful in my case.[/color]
      >
      >Who says it is experts who write JavaScript books?[/color]

      I can only feel that some people here are too demanding of the vast
      volume of "experts" would make use of JavaScript frequently.
      [color=blue]
      >The limiting factors
      >are the time required to plan and write the book and the willingness of
      >someone to publish the results, and the confidence on the part of the
      >author that what they are doing is worthwhile. But my experience is that
      >confidence in ones ability to script web browsers is more often the
      >result of not really perceiving the issues than the result of expertise.[/color]

      Perhaps, but people cannot know everything.
      [color=blue][color=green][color=darkred]
      >>>and some of the logic you apply to your reasoning,[/color]
      >>
      >>Oh? Just what it that? As it still does exactly the
      >>same as it did before, where I have just improved the
      >>error checking somewhat.[/color]
      >
      >You code was not an issue in that case. Because programmers need to
      >understand mechanical logic in order to do their job[/color]

      Yet most, as I am aware do not, when for example my top subject has
      always been mathematics, where I have a skill for well structuring
      code to produce a good result.

      Overlooking the not totally optimised code and the security issues,
      but that Order Form for what it is intended to do both looks great and
      works great.
      [color=blue]
      >I expect to see
      >more evidence of an appreciation of logic (and its limitations) in their
      >reasoned arguments than I would from someone who's debating experience
      >was exclusively rhetorical.[/color]

      The proof of the pudding is in the eating, where does not my Order
      Form look good? :-]
      [color=blue]
      >But would those former lecturers and other experienced programmers have
      >been impressed with the code you actually wrote for your order page
      >(even if they lacked any specific knowledge of JavaScript or its
      >application to a browser DOM)?[/color]

      They would have liked the results, pointed out how to better optimise
      the code, then wondered why their own programs do not look as good or
      work as well.

      It is not just about writing code, even well optimised code, but
      knowing what the end result should be doing. That is what I am good
      at, even if this Order Form one days needs moving a full shopping
      basket system.

      Well this form was created to produce automatically created order
      forms that my customers could send through the post, then later on
      added the on-line payment options to it.
      [color=blue]
      >Beyond making statements in a public forum (which obviously carry no
      >more weight than the audience choose to attach to them) there isn't a
      >great deal that I can do to influence the behaviour of the authors of
      >books on JavaScript.[/color]

      You would be surprised what you could do if you really wanted to do
      it, when both publishers and authors can be informed of such standard
      documents.
      [color=blue][color=green]
      >>Just my favoured method of data access, where having a pointer
      >>to an array allows myself and others direct memory access and
      >>to cut up and move the data about however I please.[/color]
      >
      >Having written assembly language and C I much prefer languages where I
      >don't have to think about the location of items of data in particular
      >memory structures. It was always error prone and time consuming.[/color]

      It is not too bad, when if you want to know your picture file size,
      then you can just use a sizeof function. Should that picture be a
      series of thumbnails, then you can just divide that size by the number
      of thumbnails.
      [color=blue]
      >But I
      >don't see how being able to do that with JavaScript would enable you to
      >do anything that you cannot already do (and probably more easily).[/color]

      Well JavaScript does not really need such a powerful feature. Not to
      forget that it can cause security issues.
      [color=blue]
      >Except maybe something like reaching into a 32bit integer and directly
      >pulling out only, say, the lower byte. But that is not something that
      >you need to do in higher level languages.[/color]

      I have done that before though, but you can also assemble a 32 bit
      value out say 8 bit values. Such handling tends to be useful with say
      direct graphics card programming.
      [color=blue]
      >The dynamic nature of JavaScript objects means that the ability to move
      >data about is already virtually unrestricted, you don't even have to
      >worry about the type of the data involved (beyond being aware of what
      >type it is).[/color]

      Yes a nice easy hard to break system, but of course some people are
      not aware of what is going on in their variables.
      [color=blue]
      >So again, what is it that you think that you would want to do in the
      >order form code with a pointer that cannot be done in JavaScript with an
      >object reference (and probably easier).[/color]

      As I said it is just my preferred method, when you can move any sized
      chunk of memory to any other suitably sized location. Best of all is
      that you can process this data in whatever way you desire.

      It is also a fast lower level system, but as you point out it is not
      too hard to get your sizes wrong.
      [color=blue][color=green]
      >>The final value is rounded anyway, where decimals are not
      >>really a problem.[/color]
      ><snip>
      >
      >That is not really the point. You asserted that because the script had
      >been adequately tested the fault must lie with an unknown browser.[/color]

      Yes.
      [color=blue]
      >I proposed that adequate testing would have exposed the ability on the
      >part of the user to enter fractional quantities and that because the
      >script attempted to guarantee the integrity of the order the ability of
      >the user to enter fractional quantities would have been
      >corrected/handled (in some way, though I suspect that having the script
      >actively change the value in the quantity field is not the best
      >approach).[/color]

      Had you seen my original code, then you will notice that the parseInt
      function was used a lot to deal with these issues. I simply decided to
      remove that code in my recent testing, for various reasons, including
      that it has now been improved even further.

      I have also long been aware that invalid values can be entered in this
      box, where I am also aware that JavaScript has it's own error
      checking. Since such actions cannot produce an incorrect order total,
      then I did not see it as much of an issue.
      [color=blue]
      >So evidence that the testing was not adequate[/color]

      Except that testing had not only highlighted this fraction problem
      previously, but that it had also been fixed.

      You can still see this old code in the Euro and US Dollar versions of
      this form if you wish.

      My "beta" test versions are for working with new ideas.
      [color=blue]
      >serves to
      >undermine the deduction that the problem lies with an unknown browser.[/color]

      That would be a nice idea had not your basis been invalid, where as
      the lines that produce this value are quite low in number and already
      well tested, then that is why I can say that the problem must be
      generated outside my code.

      You can see examples of these faulty Order Forms if you desire, where
      if you wish to examine the original code, then you should come to the
      same conclusion.

      Cardman


      Comment

      • Michael Winter

        #33
        Re: Some unknown browsers fail to calculate my JavaScript code.

        On Mon, 02 Feb 2004 16:02:41 +0000, Cardman <do-not@spam-me.com> wrote:
        [color=blue]
        > And I will certainly look forwards to seeing your results, where I can
        > only wonder if you are aware of all the factors. I will find out when
        > you complete it I guess.[/color]

        As you have misgivings, I've stopped development (it's all but finished,
        anyway). I'd prefer to show you the current results so that we can discuss
        any problems you might foresee.

        You will note that it doesn't look exactly like the original page. The
        first thing I did was remove the tables: your usage of them is actually
        abuse of the element. Tables should not be used for layout. I replaced
        them with CSS that performs the same layout, and I used the standard
        borders (rather than your images) to frame the menu. The colour scheme is
        also different. Finally, as this is a single demonstration page, there are
        no active links.

        If any of these issues are unsatisfactory, it would be quite trivial to
        change.

        Only one problem has shown itself so far. IE seems to have a minor display
        bug. The two URIs below are screenshots from IE and Opera, respectively.




        As you can see, IE misaligns the text that appears beyond the sidebars,
        whereas Opera doesn't. I tried increasing the margin of the text section
        to move it away from the sidebars, but it made no difference. Strange.

        A disadvantage to this system is that each page has to duplicate the
        menus, but this adds less than 3KBs to each page so the impact is minimal.
        You'll also have to manage which item is highlighted (the blue stripe),
        either through PHP or by hard-coding it. Again, hardly a serious concern.

        Little extras to point out:

        - You'll notice that "CAMs", "DiSEqC"[1] and "LNBs" on the menu have a
        dotted underline. Mousing over will display the full titles.
        - Passing the mouse over the menu items will highlight that item. This
        only happens on the menu (the first sidebar): the second and third don't
        display this behaviour. Unfortunately, the highlight doesn't work in IE as
        it doesn't support the :hover pseudo-class. I put it in simply because
        it's easy to do and a common feature in menus. If you don't want it,
        remove the rule from menu.css with the selector that ends ":hover {".
        - The page uses valid HTML 4 Strict and valid CSS 2.
        - I added alt attributes to all of the flags at the top of the page in
        their natural language. That actually occupied most of my time: looking up
        the various translated names and obtaining the correct character entity
        values.

        I put the page up at the following address:




        Mike

        [1] IE doesn't support the ABBR element for some reason so the underline
        doesn't appear. However, it does support the ACRONYM element, which is
        what the other two use. You could change it so that all use ACRONYM but,
        from a purist point of view, that is misuse (DiSEqC is an abbreviation,
        not an acronym).

        --
        Michael Winter
        M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

        Comment

        • rox

          #34
          Re: Some unknown browsers fail to calculate my JavaScript code.

          Cardman <do-not@spam-me.com> wrote in message news:<vg6r10hii l4b3f4qjeu5k09k 419obat4jr@4ax. com>...
          [color=blue]
          > Without JavaScript, then most web pages would not do anything beyond
          > moving from one page to the next, when most other popular web
          > languages (like Perl and CGI) are much harder to start off with.[/color]

          The first part of your sentence states the original premise behind
          hypertext transfer, actually. But I know you weren't making a
          generalization about the Web. In a perfect world I think you're
          talking about JavaScript enhancements, not presenting a full-fledged
          CGI application using JavaScript.

          Regarding Perl being harder to start off with, I strongly believe
          based on years of enterprise Web development that it's easier in the
          longrun to immediately learn a server-side tool like Perl/php/CGI than
          to try to do data processing with a client-side tool that will
          ultimately give you all kinds of useability (let alone
          maintainability !!!!) issues. Major waste of time IMHO.

          While I agree you have a right to draw the line concerning browser
          compatibility depending on the demographic you're serving, the
          assumption that users should just shrug and upgrade to the latest
          greatest browser doesn't make business sense. I hated worrying about
          cross browser compatibility for clients that may have been used by 9
          percent of the market. Again you make those choices based your known
          demographic. My company wanted that 9 percent. But it's dangerous to
          assume that anyone can - or worse, SHOULD - upgrade to *anything* in
          order to access a product that is implemented in a non-standard way in
          the first place. They won't.

          Cheers


          P.S.
          "Q:What do you make of the branding attempt of companies, by putting
          little icons on their home pages saying, "best when viewed with
          Microsoft Explorer, or Navigator?"

          This comes from an anxiousness to use the latest proprietary features
          which have not been agreed by all companies. It is done either by
          those who have an interest in pushing a particular company, or it is
          done by those who are anxious to take the community back to the dark
          ages of computing when a floppy from a PC wouldn't read on a Mac, and
          a Wordstar document wouldn't read in Word Perfect, or an EBCDIC file
          wouldn't read on an ASCII machine. It's fine for individuals whose
          work is going to be transient and who aren't worried about being read
          by anyone.

          However, corporate IT strategists should think very carefully about
          committing to the use of features which will bind them into the
          control of any one company. The web has exploded because it is open.
          It has developed so rapidly because the creative forces of thousands
          of companies are building on the same platform. Binding oneself to one
          company means one is limiting one's future to the innovations that one
          company can provide. - Tim Berners Lee 1996"

          Comment

          • Jim Ley

            #35
            Re: Some unknown browsers fail to calculate my JavaScript code.

            On Mon, 02 Feb 2004 17:06:21 +0000, Cardman <do-not@spam-me.com>
            wrote:[color=blue][color=green]
            >>Beyond making statements in a public forum (which obviously carry no
            >>more weight than the audience choose to attach to them) there isn't a
            >>great deal that I can do to influence the behaviour of the authors of
            >>books on JavaScript.[/color]
            >
            >You would be surprised what you could do if you really wanted to do
            >it, when both publishers and authors can be informed of such standard
            >documents.[/color]

            There's basically only a couple of authors left who'd get the money to
            produce a new javascript book, but none of them are going to, since
            there's nothing new to write on the subject.

            Most have realised they're not much good, the good ones admitting it
            (e.g. http://www.dhtml-guis.com/warning.html ) the bad ones just
            letting their books rot on the shelves.
            [color=blue]
            >You can still see this old code in the Euro and US Dollar versions of
            >this form if you wish.[/color]

            The Euro has very specific laws on how calculations are made on it -
            I'm sure you've taken these into account?

            Jim.
            --
            comp.lang.javas cript FAQ - http://jibbering.com/faq/

            Comment

            • Cardman

              #36
              Re: Some unknown browsers fail to calculate my JavaScript code.

              On Mon, 02 Feb 2004 18:21:12 GMT, Michael Winter
              <M.Winter@bluey onder.co.invali d> wrote:
              [color=blue]
              >On Mon, 02 Feb 2004 16:02:41 +0000, Cardman <do-not@spam-me.com> wrote:
              >[color=green]
              >> And I will certainly look forwards to seeing your results, where I can
              >> only wonder if you are aware of all the factors. I will find out when
              >> you complete it I guess.[/color]
              >
              >As you have misgivings, I've stopped development (it's all but finished,
              >anyway).[/color]

              Well, there was no need to do that, when I said that I would check it
              out anyway. My comment was just about that people may not understand
              my code in the first place, thereby making assumed mistakes.
              [color=blue]
              >I'd prefer to show you the current results so that we can discuss
              >any problems you might foresee.[/color]

              Whatever, when it needs to be checked in the end anyway.
              [color=blue]
              >You will note that it doesn't look exactly like the original page.[/color]

              You got the flags, the text and nothing else.
              [color=blue]
              >The first thing I did was remove the tables: your usage of them is
              >actually abuse of the element.[/color]

              Well I did that in the first place, when it is the best choice from
              using frames. Your method may certainly be a better option though, but
              it depends on how it handles image placement I guess.
              [color=blue]
              >Tables should not be used for layout.[/color]

              Yet they work so well... :~(

              Well I do not see issues with abusing tables as long as it is not
              breaking a Universal law.
              [color=blue]
              >I replaced
              >them with CSS that performs the same layout, and I used the standard
              >borders (rather than your images) to frame the menu.[/color]

              I must admit that it is the menu that worries me the most, when the
              outer structure is nice, the text is too small, where as I will
              mention below is does not work much.
              [color=blue]
              >The colour scheme is also different.[/color]

              The lack of colours I can see as a problem, when I have always like my
              colour bars...

              <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
              <TR VALIGN=TOP ALIGN=CENTER>
              <TD COLSPAN=10 WIDTH=300 CLASS="TextObje ct"
              STYLE="backgrou nd-color: rgb(255,0,0);"> <P STYLE="text-align: left;">
              <BR>
              </TD>
              </TR>
              </TABLE>

              Unless that result can be duplicated without using a table, then a
              table doing formatting it will have to be. After all my sections need
              to be broken up, where doing this is much better than using bars.
              [color=blue]
              >Finally, as this is a single demonstration page, there are
              >no active links.[/color]

              I see, where I presume that is the usual HREF thing.
              [color=blue]
              >If any of these issues are unsatisfactory, it would be quite trivial to
              >change.[/color]

              The menu I can see is a problem, then the lack of colours will need
              fixing, but that should be easy enough.
              [color=blue]
              >Only one problem has shown itself so far. IE seems to have a minor display
              >bug. The two URIs below are screenshots from IE and Opera, respectively.
              >
              > http://www.mlwinter.pwp.blueyonder.co.uk/cardman/ie.gif
              > http://www.mlwinter.pwp.blueyonder.c...dman/opera.gif
              >
              >As you can see, IE misaligns the text that appears beyond the sidebars,
              >whereas Opera doesn't. I tried increasing the margin of the text section
              >to move it away from the sidebars, but it made no difference. Strange.[/color]

              Well you know what Microsoft it like, when if it works perfectly, then
              it is not Microsoft.
              [color=blue]
              >A disadvantage to this system is that each page has to duplicate the
              >menus,[/color]

              That sounds like the reason why I used JavaScript in the first place,
              when do you know how many pages I have? Seventy eight is the answer to
              that, which is why it was a real bugger to add a new menu option to
              each and every page.
              [color=blue]
              >but this adds less than 3KBs to each page so the impact is minimal.[/color]

              Over a small volume of 78 pages...
              [color=blue]
              >You'll also have to manage which item is highlighted (the blue stripe),
              >either through PHP or by hard-coding it. Again, hardly a serious concern.[/color]

              Exactly like I used to do with my current buttons, where the problem
              with this is that you now cannot just "duplicate the menus".
              [color=blue]
              >Little extras to point out:
              >
              >- You'll notice that "CAMs", "DiSEqC"[1] and "LNBs" on the menu have a
              >dotted underline. Mousing over will display the full titles.[/color]

              One problem is that mouse over them does not produce this text on
              either MIE or Netscape. I think you may have a problem.

              Since I well explain what these items are on my pages, then I doubt
              that I need this feature, when these abbreviations are better known
              anyway.
              [color=blue]
              >- Passing the mouse over the menu items will highlight that item.[/color]

              It does on Netcape, but not on MIE.
              [color=blue]
              >This only happens on the menu (the first sidebar): the second and third
              >don't display this behaviour.[/color]

              Can they is the more important question?
              [color=blue]
              >Unfortunatel y, the highlight doesn't work in IE as
              >it doesn't support the :hover pseudo-class.[/color]

              I see. My current page seems more compatible at the moment.
              [color=blue]
              >I put it in simply because
              >it's easy to do and a common feature in menus. If you don't want it,
              >remove the rule from menu.css with the selector that ends ":hover {".[/color]

              I see.
              [color=blue]
              >- The page uses valid HTML 4 Strict and valid CSS 2.[/color]

              And it does not function much. Are you sure that this stuff is
              supposed to be browser compatible? As if I normally saw results like
              that, then I would not use it.
              [color=blue]
              >- I added alt attributes to all of the flags at the top of the page in
              >their natural language. That actually occupied most of my time: looking up
              >the various translated names and obtaining the correct character entity
              >values.[/color]

              Yes, where that is the section that I like the most. Nice layout
              across the entire page, the alt names, where it all goes together
              better than what I currently have.

              Netscape 7.1 does not display your alt names though.
              [color=blue]
              >I put the page up at the following address:
              >
              > http://www.mlwinter.pwp.blueyonder.co.uk/cardman/[/color]

              On your home page I see.
              [color=blue]
              >[1] IE doesn't support the ABBR element for some reason so the underline
              >doesn't appear. However, it does support the ACRONYM element, which is
              >what the other two use. You could change it so that all use ACRONYM but,
              > from a purist point of view, that is misuse (DiSEqC is an abbreviation,
              >not an acronym).[/color]

              You know me. Go with what works...

              Anyway, there are several useful changes there, but the menu I do not
              think is working out.

              Cardman


              Comment

              • Cardman

                #37
                Re: Some unknown browsers fail to calculate my JavaScript code.

                On Mon, 02 Feb 2004 19:56:14 GMT, jim@jibbering.c om (Jim Ley) wrote:
                [color=blue][color=green]
                >>You can still see this old code in the Euro and US Dollar versions of
                >>this form if you wish.[/color]
                >
                >The Euro has very specific laws on how calculations are made on it -
                >I'm sure you've taken these into account?[/color]

                That I am sure only applies to Euro-linked currencies, when in the UK
                it is still foreign rubbish.

                There is a bit of a conversion issue here though, then rounding all
                the Sterling values to Euro produces a value at the end that does not
                add up to all the sub-figures.

                All values are correct though, when it is just the rounding that
                screws about with it. Since nothing can be done about that beyond
                faking the figures, then that is why it is like it is.

                Cardman


                Comment

                • Richard Cornford

                  #38
                  Re: Some unknown browsers fail to calculate my JavaScript code.

                  "Cardman" <do-not@spam-me.com> wrote in message
                  news:f5ts10p9co p6udjvcqpcrb81m 2e9bbs5m7@4ax.c om...
                  <snip>[color=blue][color=green]
                  >>The argument that says that what works on some large
                  >>percentage of browsers must be the right thing to do
                  >>is the argument used for writing IE only code. So not
                  >>really part of the techniques for cross-browser scripting.[/color]
                  >
                  >It works on Netscape and the other browsers that I have
                  >tried as well, but as mentioned that problem is now fixed.[/color]

                  It is not a question of whether something works on some tested sub-set
                  of browsers. It is a question of whether it should be expected to work
                  on all browsers. Valid mark-up brings the expectation of specified
                  handling and so consistency, invalid mark-up does not.

                  <snip>[color=blue]
                  >Well since I have never heard of CSS until visiting
                  >this group,[/color]

                  Those programming qualifications weren't web related then.
                  [color=blue]
                  >then that explains why I did not use it. Also I would have
                  >to make sure that my HTML editor likes the code.[/color]

                  Bad HTML editing software does not justify creating bad HTML. My
                  experience of programs like Dreamweaver is that unless the HTML is
                  created entirely by hand in its code view its output HTML is between 4
                  and 20 times bloated from what a knowledgeable human would produce, and
                  Front Page is 10 times as bad. The effect is that attempting to optimise
                  WSYWIG HTML editor output for download speed is actually more work than
                  (re)creating the HTML/CSS from scratch in a reasonably co-operative text
                  editor.

                  <snip>[color=blue][color=green]
                  >>Who says it is experts who write JavaScript books?[/color]
                  >
                  >I can only feel that some people here are too demanding
                  >of the vast volume of "experts" would make use of
                  >JavaScript frequently.[/color]

                  When the books omit standard (and extremely useful) language structures
                  and then go on teach bad practices, such as eval abuse and UA string
                  testing, then it seems reasonable to point out that those books are bad.

                  <snip>[color=blue][color=green]
                  >>... . But my experience is that confidence in ones
                  >>ability to script web browsers is more often the
                  >>result of not really perceiving the issues than the
                  >>result of expertise.[/color]
                  >
                  >Perhaps, but people cannot know everything.[/color]

                  Which represents very good grounds for suspecting yourself of being
                  deluded whenever you find yourself believing that you know everything.

                  <snip>[color=blue][color=green]
                  >>... . Because programmers need to understand
                  >>mechanical logic in order to do their job[/color]
                  >
                  >Yet most, as I am aware do not, when for example my top subject
                  >has always been mathematics, where I have a skill for well
                  >structuring code to produce a good result.[/color]

                  Are these programmes who have somehow omitted learning a fundamental
                  pre-requisite of their craft by any chance the "experience d programmers"
                  who you say have been impressed with your coding?

                  <snip>[color=blue]
                  >The proof of the pudding is in the eating, where does not
                  >my Order Form look good? :-][/color]

                  What has the appearance of the GUI have to do with the design of the
                  script code behind it?
                  [color=blue][color=green]
                  >>But would those former lecturers and other experienced
                  >>programmers have been impressed with the code you actually
                  >>wrote for your order page (even if they lacked any specific
                  >>knowledge of JavaScript or its application to a browser DOM)?[/color]
                  >
                  >They would have liked the results, pointed out how to better
                  >optimise the code, then wondered why their own programs do not
                  >look as good or work as well.[/color]

                  Incredible, we must know very different programmers (and computer
                  science lecturers). It might be that most of the programmers I know work
                  in financial services, where mistakes can cost somebody lots of money
                  (and/or their job), and so they care a great deal about the theory and
                  practice of software design.

                  <snip>[color=blue][color=green]
                  >>So again, what is it that you think that you would want to
                  >>do in the order form code with a pointer that cannot be done
                  >>in JavaScript with an object reference (and probably easier).[/color]
                  >
                  >As I said it is just my preferred method, when you can move
                  >any sized chunk of memory to any other suitably sized location.
                  >Best of all is that you can process this data in whatever way
                  >you desire.[/color]

                  So whether or not JavaScript has no pointer has no real baring on your
                  order form implementation and there was no point in you raising the lack
                  of pointers in the first place.

                  <snip>[color=blue]
                  >Had you seen my original code, then you will notice that
                  >the parseInt function was used a lot ...[/color]
                  <snip>

                  What exactly is the rational behind asking for help identifying a
                  problem with some code and then presenting code for consideration that
                  is not the code exhibiting the symptoms?

                  Richard.


                  Comment

                  • Cardman

                    #39
                    Re: Some unknown browsers fail to calculate my JavaScript code.

                    On Mon, 2 Feb 2004 22:04:15 -0000, "Richard Cornford"
                    <Richard@litote s.demon.co.uk> wrote:
                    [color=blue]
                    >Those programming qualifications weren't web related then.[/color]

                    No, more along the line of commercial data processing, where I then
                    did a fair chunk of industrial programming. I have also done a lot of
                    PC system programming as well.
                    [color=blue]
                    >When the books omit standard (and extremely useful) language structures
                    >and then go on teach bad practices, such as eval abuse and UA string
                    >testing, then it seems reasonable to point out that those books are bad.[/color]

                    Try to think more in degrees of badness than with a simple on/off
                    system, when that seems to be your problem.
                    [color=blue][color=green]
                    >>Perhaps, but people cannot know everything.[/color]
                    >
                    >Which represents very good grounds for suspecting yourself of being
                    >deluded whenever you find yourself believing that you know everything.[/color]

                    Like how above I pointed out how I never heard of CSS before? Seems
                    that your points and the facts do not match.
                    [color=blue]
                    >Are these programmes who have somehow omitted learning a fundamental
                    >pre-requisite of their craft by any chance the "experience d programmers"
                    >who you say have been impressed with your coding?[/color]

                    Some of your questions do not even deserve an answer...
                    [color=blue]
                    ><snip>[color=green]
                    >>The proof of the pudding is in the eating, where does not
                    >>my Order Form look good? :-][/color]
                    >
                    >What has the appearance of the GUI have to do with the design of the
                    >script code behind it?[/color]

                    Not just appearance, but also functionality. A program is a whole and
                    not just one of it's parts.
                    [color=blue]
                    >Incredible, we must know very different programmers (and computer
                    >science lecturers). It might be that most of the programmers I know work
                    >in financial services, where mistakes can cost somebody lots of money
                    >(and/or their job), and so they care a great deal about the theory and
                    >practice of software design.[/color]

                    Good for them, but once your program works, then that is the end of
                    it. Time to go home, when further optimization is just doing the same
                    thing slightly better.

                    Design and testing is of course very important in all software
                    development.
                    [color=blue]
                    >So whether or not JavaScript has no pointer has no real baring on your
                    >order form implementation and there was no point in you raising the lack
                    >of pointers in the first place.[/color]

                    It was only a brief unimportant comment, which someone around here
                    desired to interrogate.
                    [color=blue]
                    >What exactly is the rational behind asking for help identifying a
                    >problem with some code and then presenting code for consideration that
                    >is not the code exhibiting the symptoms?[/color]

                    Had you seen my original posting then you will know that all the facts
                    and the correct code was presented at the time. Further comments
                    simply pointed out the new code that I have been working on.

                    However, life goes on, where it is now February, where my business had
                    to be updated for another month.

                    Should you desire to see the original Sterling version, then I can
                    certainly put a copy on-line. Since no one seems to have an answer for
                    my problem, then I did not consider it work the time, when I should
                    have error trapped the problem anyway.

                    Anyway, please stop waving your manhood around.

                    Cardman


                    Comment

                    • Michael Winter

                      #40
                      Re: Some unknown browsers fail to calculate my JavaScript code.

                      On Mon, 02 Feb 2004 21:32:33 +0000, Cardman <do-not@spam-me.com> wrote:
                      [color=blue]
                      > On Mon, 02 Feb 2004 18:21:12 GMT, Michael Winter
                      > <M.Winter@bluey onder.co.invali d> wrote:[/color]

                      [snip]
                      [color=blue][color=green]
                      >> You will note that it doesn't look exactly like the original page.[/color]
                      >
                      > You got the flags, the text and nothing else.[/color]

                      It's a demonstration page. :)

                      The layout is virtually identical: flags across the top, sidebar down the
                      side, and text down the right. I didn't replicate all of the sidebar, but
                      I showed that more than one group can exist, so it would be possible to
                      recreate it. With the flexibility of CSS, it would be simple to tailor the
                      look of this, and other elements, of the page.

                      [snip]
                      [color=blue][color=green]
                      >> Tables should not be used for layout.[/color]
                      >
                      > Yet they work so well... :~(
                      >
                      > Well I do not see issues with abusing tables as long as it is not
                      > breaking a Universal law.[/color]

                      Someone else might be able to argue this better than me (especially on
                      comp.infosystem s.www.authoring.html)...

                      The opposition of tables for layout is both a purist, and practical one.

                      The practical view focuses mainly around accessibility, particularly for
                      blind users. Tables, when presented by aural browsers, are spoken in a
                      certain logical order. When presenting tabular data, this order makes
                      sense. When used purely for layout, it doesn't at all: columns and rows
                      contain disjointed information which is not related in any way. This would
                      break entirely the ability to convey information to people who would use
                      such browsers.

                      The purist view is that HTML elements represent specific parts of the
                      structure of a document. To properly maintain the correct grammar of the
                      document, each element should only be used for the job it was designed to
                      do. In the case of tables, it is to represent tabular data, not layout a
                      page. Whilst you could dismiss this with, "Well, it works", it should be
                      viewed the same way as you might view malformed grammar of a C program:
                      something that is inherently wrong and in need of fixing.
                      [color=blue][color=green]
                      >> I replaced
                      >> them with CSS that performs the same layout, and I used the standard
                      >> borders (rather than your images) to frame the menu.[/color]
                      >
                      > I must admit that it is the menu that worries me the most, when the
                      > outer structure is nice, the text is too small, where as I will
                      > mention below is does not work much.[/color]

                      The text size can be changed extremely easily (changing a "font-size: 80%"
                      string to "font-size: 90%", for example).
                      [color=blue][color=green]
                      >> The colour scheme is also different.[/color]
                      >
                      > The lack of colours I can see as a problem, when I have always like my
                      > colour bars...
                      >
                      > <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
                      > <TR VALIGN=TOP ALIGN=CENTER>
                      > <TD COLSPAN=10 WIDTH=300 CLASS="TextObje ct"
                      > STYLE="backgrou nd-color: rgb(255,0,0);"> <P STYLE="text-align: left;">
                      > <BR>
                      > </TD>
                      > </TR>
                      > </TABLE>
                      >
                      > Unless that result can be duplicated without using a table, then a
                      > table doing formatting it will have to be. After all my sections need
                      > to be broken up, where doing this is much better than using bars.[/color]

                      As a CSS rule:

                      element {
                      border-color: #ff0000;
                      border-style: solid none;
                      border-width: 1px;
                      }

                      This will place a 1 pixel thick, red border above and below the element,
                      "element". You'd want to be more selective, only making a element that
                      belongs to a certain class have this border but again, this is only a demo.
                      [color=blue][color=green]
                      >> Finally, as this is a single demonstration page, there are
                      >> no active links.[/color]
                      >
                      > I see, where I presume that is the usual HREF thing.[/color]

                      I didn't see the point of adding links to the menu as I've got nowhere for
                      them to go (unless I link to your site, of course).

                      [snip]
                      [color=blue][color=green]
                      >> A disadvantage to this system is that each page has to duplicate the
                      >> menus,[/color]
                      >
                      > That sounds like the reason why I used JavaScript in the first place,
                      > when do you know how many pages I have? Seventy eight is the answer to
                      > that, which is why it was a real bugger to add a new menu option to
                      > each and every page.[/color]

                      That's why you use PHP to insert it. :)
                      [color=blue][color=green]
                      >> but this adds less than 3KBs to each page so the impact is minimal.[/color]
                      >
                      > Over a small volume of 78 pages...[/color]

                      The total doesn't really matter much. 3KBs extra on one page at a time
                      adds about a second on my 56K modem. Your users aren't downloading all 78
                      pages at one time, so I don't see the point of your argument.
                      Also, removing the extra mark-up due to table use will reduce the overhead
                      still further.
                      [color=blue][color=green]
                      >> You'll also have to manage which item is highlighted (the blue stripe),
                      >> either through PHP or by hard-coding it. Again, hardly a serious
                      >> concern.[/color]
                      >
                      > Exactly like I used to do with my current buttons, where the problem
                      > with this is that you now cannot just "duplicate the menus".[/color]

                      The only thing that should change between the menus on each page is which
                      item is marked as current. In the menu, that is simply an id value
                      (id="current-menu-item").
                      [color=blue][color=green]
                      >> Little extras to point out:
                      >>
                      >> - You'll notice that "CAMs", "DiSEqC"[1] and "LNBs" on the menu have a
                      >> dotted underline. Mousing over will display the full titles.[/color]
                      >
                      > One problem is that mouse over them does not produce this text on
                      > either MIE or Netscape. I think you may have a problem.[/color]

                      It does on IE 5.5 and Opera 7.23. Netscape might place it in the status
                      bar (that's what Opera does in addition to a tooltip).
                      [color=blue]
                      > Since I well explain what these items are on my pages, then I doubt
                      > that I need this feature, when these abbreviations are better known
                      > anyway.[/color]

                      Just showing it can be done. It's sometimes nice to be reminded what
                      certain abbreviations mean. The W3C do the same for CSS, DOM, XML and
                      HTML, for example. You would think that most people (that care) would know
                      those too.

                      [snip]
                      [color=blue][color=green]
                      >> This only happens on the menu (the first sidebar): the second and third
                      >> don't display this behaviour.[/color]
                      >
                      > Can they is the more important question?[/color]

                      Yes.
                      [color=blue][color=green]
                      >> Unfortunately, the highlight doesn't work in IE as
                      >> it doesn't support the :hover pseudo-class.[/color]
                      >
                      > I see.[/color]

                      Blame Microsoft. The CSS 2 specification is almost 6 years old. You would
                      hope that they could implement it by now, but alas, no.
                      [color=blue]
                      > My current page seems more compatible at the moment.[/color]

                      Your page doesn't do this, so you can't compare.

                      [snip]
                      [color=blue][color=green]
                      >> - The page uses valid HTML 4 Strict and valid CSS 2.[/color]
                      >
                      > And it does not function much. Are you sure that this stuff is
                      > supposed to be browser compatible? As if I normally saw results like
                      > that, then I would not use it.[/color]

                      How many times do I need to say this: it's a demonstration page. I even
                      said at the beginning of my previous post that I didn't finish it.

                      What doesn't work?

                      Links on the menus? That would be because there aren't any.
                      Hover highlighting with IE? That's because IE is crap.
                      [color=blue][color=green]
                      >> - I added alt attributes to all of the flags at the top of the page in
                      >> their natural language. That actually occupied most of my time: looking
                      >> up
                      >> the various translated names and obtaining the correct character entity
                      >> values.[/color]
                      >
                      > Yes, where that is the section that I like the most. Nice layout
                      > across the entire page, the alt names, where it all goes together
                      > better than what I currently have.
                      >
                      > Netscape 7.1 does not display your alt names though.[/color]

                      I meant to add title attributes, too. It should display those. I was only
                      immediately concerned with the alt attributes because they're required in
                      Strict HTML.
                      [color=blue][color=green]
                      >> I put the page up at the following address:
                      >>
                      >> http://www.mlwinter.pwp.blueyonder.co.uk/cardman/[/color]
                      >
                      > On your home page I see.[/color]

                      A dumping ground for things I might want to show or store on-line. There
                      is no home page: I can never think of useful or interesting things to
                      post. If I get a large number of solutions that I provided to this group,
                      I might host them in case they come up again in the future. Mostly it's
                      been corrections to scripts, rather than full, from-scratch examples, in
                      my posts to date.

                      [snip]

                      Mike

                      --
                      Michael Winter
                      M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

                      Comment

                      • Cardman

                        #41
                        Re: Some unknown browsers fail to calculate my JavaScript code.

                        On Tue, 03 Feb 2004 00:01:24 GMT, Michael Winter
                        <M.Winter@bluey onder.co.invali d> wrote:
                        [color=blue]
                        >It's a demonstration page. :)[/color]

                        Officially downgraded then. ;-]

                        No problem, when there are lots of useful ideas there.
                        [color=blue]
                        >The layout is virtually identical:[/color]

                        Cough, cough...
                        [color=blue]
                        >flags across the top,[/color]

                        Actually my flags do not cover the menu, when if they did, then the
                        menu would be out of sync to the menus on the other pages.
                        [color=blue]
                        >sidebar down the side, and text down the right.[/color]

                        Yes that is the same, where the non-table structuring is bound to be
                        useful.
                        [color=blue]
                        >I didn't replicate all of the sidebar, but I showed that more than
                        >one group can exist, so it would be possible to recreate it.[/color]

                        Yes, easy enough to do.
                        [color=blue]
                        >With the flexibility of CSS, it would be simple to tailor the
                        >look of this, and other elements, of the page.[/color]

                        Any good CSS reference guide around? I would look myself, but you
                        probably would know better.
                        [color=blue]
                        >The text size can be changed extremely easily (changing a "font-size: 80%"
                        >string to "font-size: 90%", for example).[/color]

                        Somewhere around 120 to 150 sounds about right.
                        [color=blue][color=green]
                        >> Unless that result can be duplicated without using a table, then a
                        >> table doing formatting it will have to be. After all my sections need
                        >> to be broken up, where doing this is much better than using bars.[/color]
                        >
                        >As a CSS rule:
                        >
                        > element {
                        > border-color: #ff0000;
                        > border-style: solid none;
                        > border-width: 1px;
                        > }[/color]

                        Good to hear that this is possible.
                        [color=blue]
                        >This will place a 1 pixel thick, red border above and below the element,
                        >"element". You'd want to be more selective, only making a element that
                        >belongs to a certain class have this border but again, this is only a demo.[/color]

                        Well my sections are divided into two around the title, one following
                        the page description, as many as it takes to separate items, then one
                        at the base of the page.

                        There are exceptions to this rule, like with my News page.
                        [color=blue][color=green][color=darkred]
                        >>> Finally, as this is a single demonstration page, there are
                        >>> no active links.[/color]
                        >>
                        >> I see, where I presume that is the usual HREF thing.[/color]
                        >
                        >I didn't see the point of adding links to the menu as I've got nowhere for
                        >them to go (unless I link to your site, of course).[/color]

                        Just checking to make sure that CSS does not have its own method.
                        [color=blue][color=green]
                        >> That sounds like the reason why I used JavaScript in the first place,
                        >> when do you know how many pages I have? Seventy eight is the answer to
                        >> that, which is why it was a real bugger to add a new menu option to
                        >> each and every page.[/color]
                        >
                        >That's why you use PHP to insert it. :)[/color]

                        True, but that is another one of those undesirable restructuring my
                        site things. As even something like changing my page format to this
                        new system could well take months.

                        I am a busy person...
                        [color=blue][color=green][color=darkred]
                        >>> but this adds less than 3KBs to each page so the impact is minimal.[/color]
                        >>
                        >> Over a small volume of 78 pages...[/color]
                        >
                        >The total doesn't really matter much. 3KBs extra on one page at a time
                        >adds about a second on my 56K modem.[/color]

                        This time it is not a retrieval speed issue, but one you would know if
                        you try to manually update a complex menu on 78 pages, while at the
                        same time you have other pressing matters to attend to.
                        [color=blue]
                        >Your users aren't downloading all 78
                        >pages at one time, so I don't see the point of your argument.[/color]

                        My point is that you have recreated the problem of why I moved my menu
                        to JavaScript in the first place, when I do not wish to HTML edit 78
                        pages (and growing by the day) every time that I want to add a new
                        main section.

                        Yes PHP...
                        [color=blue][color=green][color=darkred]
                        >>> You'll also have to manage which item is highlighted (the blue stripe),
                        >>> either through PHP or by hard-coding it. Again, hardly a serious
                        >>> concern.[/color]
                        >>
                        >> Exactly like I used to do with my current buttons, where the problem
                        >> with this is that you now cannot just "duplicate the menus".[/color]
                        >
                        >The only thing that should change between the menus on each page is which
                        >item is marked as current. In the menu, that is simply an id value
                        >(id="current-menu-item").[/color]

                        Yes, not unlike what I had before. Copy, open the file, scroll down,
                        delete the menu, paste the new menu, edit if needed, copy if needed,
                        save the file, close the file.

                        Seventy seven more files to go...
                        [color=blue][color=green][color=darkred]
                        >>> - You'll notice that "CAMs", "DiSEqC"[1] and "LNBs" on the menu have a
                        >>> dotted underline. Mousing over will display the full titles.[/color]
                        >>
                        >> One problem is that mouse over them does not produce this text on
                        >> either MIE or Netscape. I think you may have a problem.[/color]
                        >
                        >It does on IE 5.5 and Opera 7.23.[/color]

                        I have MIE 6.0.2800.

                        I hope you know that Microsoft has broke your menu in their latest
                        browser versions.
                        [color=blue]
                        >Netscape might place it in the status
                        >bar (that's what Opera does in addition to a tooltip).[/color]

                        It is good for Netscape I am pleased to say, when it is working now,
                        even if it was not before. Kind of strange, but there you go.

                        I will check again later and see what Netscape does then.
                        [color=blue][color=green][color=darkred]
                        >>> Unfortunately, the highlight doesn't work in IE as
                        >>> it doesn't support the :hover pseudo-class.[/color]
                        >>
                        >> I see.[/color]
                        >
                        >Blame Microsoft. The CSS 2 specification is almost 6 years old. You would
                        >hope that they could implement it by now, but alas, no.[/color]

                        Sounds like Microsoft want to promote their own version.
                        [color=blue][color=green]
                        >> My current page seems more compatible at the moment.[/color]
                        >
                        >Your page doesn't do this, so you can't compare.[/color]

                        It all depends on what the majority of browsers like.
                        [color=blue]
                        >How many times do I need to say this: it's a demonstration page. I even
                        >said at the beginning of my previous post that I didn't finish it.
                        >
                        >What doesn't work?[/color]

                        Just the things that you said would work, but it is getting better it
                        seems. :-]
                        [color=blue]
                        >Hover highlighting with IE? That's because IE is crap.[/color]

                        The world's most popular browser is crap...

                        It may be crap, not that it seems too crap to me, but it would not be
                        the best idea to ignore it.
                        [color=blue][color=green][color=darkred]
                        >>> I put the page up at the following address:
                        >>>
                        >>> http://www.mlwinter.pwp.blueyonder.co.uk/cardman/[/color]
                        >>
                        >> On your home page I see.[/color]
                        >
                        >A dumping ground for things I might want to show or store on-line. There
                        >is no home page: I can never think of useful or interesting things to
                        >post.[/color]

                        Why you sad lonely person. ;-]

                        You must have hobbies or something. I of course have my business, but
                        I have been thinking for a while about making a site for my Charmed
                        (the series) items.

                        In fact had I wanted to, then I could come up with a good dozen site
                        ideas that would be of interest to me and others.
                        [color=blue]
                        >If I get a large number of solutions that I provided to this group,
                        >I might host them in case they come up again in the future. Mostly it's
                        >been corrections to scripts, rather than full, from-scratch examples, in
                        >my posts to date.[/color]

                        Sounds like it has promise for a site though. Maybe one for all those
                        cool tricks that people are always looking for would be an idea.

                        Anyway, when I get the time, then I will see how I can fit CSS into my
                        site instead of using these tables. That menu still does not get my
                        favour though, but it may work out if I smack it around enough.

                        Cardman


                        Comment

                        • Bas Cost Budde

                          #42
                          Re: Some unknown browsers fail to calculate my JavaScript code.

                          Cardman wrote:
                          [color=blue][color=green]
                          >>The Euro has very specific laws on how calculations are made on it -
                          >>I'm sure you've taken these into account?[/color]
                          >
                          > That I am sure only applies to Euro-linked currencies, when in the UK
                          > it is still foreign rubbish.
                          >
                          > There is a bit of a conversion issue here though, then rounding all
                          > the Sterling values to Euro produces a value at the end that does not
                          > add up to all the sub-figures.
                          >
                          > All values are correct though, when it is just the rounding that
                          > screws about with it. Since nothing can be done about that beyond
                          > faking the figures, then that is why it is like it is.[/color]

                          AFAIK the Euro procedure is that you have to perform all intermediate
                          (euro!) calculations with four decimals precision, and may round the
                          result only (two decimals).

                          If/when the calculation is using pound sterling, that procedure doesn't
                          apply. I think you round in the end, Cardman? Who cares what you did
                          before? I get some value with two decimal positions, convert by using my
                          six digit conversion factor, display the euro amount.

                          You shouldn't, of course, convert every intermediate result to euro, add
                          those up, and then get upset about missing 100ths. At least they always
                          taught me "don't round (convert!) your intermediate results!"
                          --
                          Bas Cost Budde


                          Comment

                          • Michael Winter

                            #43
                            Re: Some unknown browsers fail to calculate my JavaScript code.

                            On Tue, 03 Feb 2004 02:10:52 +0000, Cardman <do-not@spam-me.com> wrote:
                            [color=blue]
                            > On Tue, 03 Feb 2004 00:01:24 GMT, Michael Winter
                            > <M.Winter@bluey onder.co.invali d> wrote:[/color]

                            [snip]
                            [color=blue][color=green]
                            >> The layout is virtually identical:[/color]
                            >
                            > Cough, cough...[/color]

                            Virtually...
                            [color=blue][color=green]
                            >> flags across the top,[/color]
                            >
                            > Actually my flags do not cover the menu, when if they did, then the
                            > menu would be out of sync to the menus on the other pages.[/color]

                            If CSS is disabled or overridden (users can specify their own style sheets
                            if they wish), the flags still appear at the top of the page, which is a
                            more logical location for them.

                            [snip]
                            [color=blue]
                            > Any good CSS reference guide around? I would look myself, but you
                            > probably would know better.[/color]

                            I just use the W3C's CSS Specification. You'll probably want to do a lot
                            of experimentation as using style sheets can be somewhat fiddly.

                            http://www.w3.org/TR/CSS2/

                            Only CSS 1 and 2 are viable at the moment. As you've already seen, the
                            World's most used browser can barely manage CSS 2, so 2.1 and 3 aren't
                            really of much use yet. 2.1 and 3 aren't finished yet, anyway.
                            [color=blue][color=green]
                            >> The text size can be changed extremely easily (changing a "font-size:
                            >> 80%"
                            >> string to "font-size: 90%", for example).[/color]
                            >
                            > Somewhere around 120 to 150 sounds about right.[/color]

                            The font size is relative to that of the main page text. Unless you want
                            the menu to be more prominent than the content, 100% would be the maximum.

                            [snip]
                            [color=blue][color=green]
                            >> This will place a 1 pixel thick, red border above and below the element,
                            >> "element". You'd want to be more selective, only making a element that
                            >> belongs to a certain class have this border but again, this is only a
                            >> demo.[/color]
                            >
                            > Well my sections are divided into two around the title, one following
                            > the page description, as many as it takes to separate items, then one
                            > at the base of the page.[/color]

                            The basic approach would be to place each item in a DIV with class "item",
                            say, then specify rules for them and the title (H1, id="title") that adds
                            the borders.

                            [snip]
                            [color=blue][color=green][color=darkred]
                            >>> That sounds like the reason why I used JavaScript in the first place,
                            >>> when do you know how many pages I have? Seventy eight is the answer to
                            >>> that, which is why it was a real bugger to add a new menu option to
                            >>> each and every page.[/color]
                            >>
                            >> That's why you use PHP to insert it. :)[/color]
                            >
                            > True, but that is another one of those undesirable restructuring my
                            > site things. As even something like changing my page format to this
                            > new system could well take months.
                            >
                            > I am a busy person...[/color]

                            Even if you resort to copy and paste, it should only take a couple of
                            hours.
                            [color=blue][color=green][color=darkred]
                            >>>> but this adds less than 3KBs to each page so the impact is minimal.
                            >>>
                            >>> Over a small volume of 78 pages...[/color]
                            >>
                            >> The total doesn't really matter much. 3KBs extra on one page at a time
                            >> adds about a second on my 56K modem.[/color]
                            >
                            > This time it is not a retrieval speed issue, but one you would know if
                            > you try to manually update a complex menu on 78 pages, while at the
                            > same time you have other pressing matters to attend to.[/color]

                            You seem to be approaching this update thing with the idea that it has to
                            be started and finished in the same day. Why?

                            The approach I take is to replicate the website on my hard disk (including
                            directory structure) and work on that. Once it's finished, I upload it all
                            in one go, closing the site first with a dummy front page and uploading
                            the new one last. If you needed to, you could take a year to rewrite the
                            site and keep the current one active until it's finished. The only thorn
                            in your side would be having to keep the current site up-to-date.

                            [snip]
                            [color=blue][color=green][color=darkred]
                            >>>> You'll also have to manage which item is highlighted (the blue
                            >>>> stripe),
                            >>>> either through PHP or by hard-coding it. Again, hardly a serious
                            >>>> concern.
                            >>>
                            >>> Exactly like I used to do with my current buttons, where the problem
                            >>> with this is that you now cannot just "duplicate the menus".[/color]
                            >>
                            >> The only thing that should change between the menus on each page is
                            >> which
                            >> item is marked as current. In the menu, that is simply an id value
                            >> (id="current-menu-item").[/color]
                            >
                            > Yes, not unlike what I had before. Copy, open the file, scroll down,
                            > delete the menu, paste the new menu, edit if needed, copy if needed,
                            > save the file, close the file.[/color]

                            Never heard of "Find and Replace"?
                            [color=blue][color=green][color=darkred]
                            >>>> - You'll notice that "CAMs", "DiSEqC"[1] and "LNBs" on the menu have a
                            >>>> dotted underline. Mousing over will display the full titles.
                            >>>
                            >>> One problem is that mouse over them does not produce this text on
                            >>> either MIE or Netscape. I think you may have a problem.[/color]
                            >>
                            >> It does on IE 5.5 and Opera 7.23.[/color]
                            >
                            > I have MIE 6.0.2800.
                            >
                            > I hope you know that Microsoft has broke your menu in their latest
                            > browser versions.[/color]

                            It never ceases to amaze me just how much Microsoft can manage to cock
                            up...

                            [snip]
                            [color=blue][color=green][color=darkred]
                            >>>> Unfortunately, the highlight doesn't work in IE as
                            >>>> it doesn't support the :hover pseudo-class.
                            >>>
                            >>> I see.[/color]
                            >>
                            >> Blame Microsoft. The CSS 2 specification is almost 6 years old. You
                            >> would hope that they could implement it by now, but alas, no.[/color]
                            >
                            > Sounds like Microsoft want to promote their own version.[/color]

                            No, that's problem: they don't have their own version, nor do they
                            implement the standard one.
                            [color=blue][color=green]
                            >> How many times do I need to say this: it's a demonstration page. I even
                            >> said at the beginning of my previous post that I didn't finish it.
                            >>
                            >> What doesn't work?[/color]
                            >
                            > Just the things that you said would work, but it is getting better it
                            > seems. :-]
                            >[color=green]
                            >> Hover highlighting with IE? That's because IE is crap.[/color]
                            >
                            > The world's most popular browser is crap...[/color]

                            It's vulnerable to security exploits, slow, error prone, unstable, and
                            can't manage to implement even basic standards properly that are several
                            *years* older than itself.
                            [color=blue]
                            > It may be crap, not that it seems too crap to me, but it would not be
                            > the best idea to ignore it.[/color]

                            I wouldn't ignore it, but I wouldn't spend too much time making it work
                            with everything. Users could still easily navigate the site, but they
                            wouldn't see all of the presentation elements that users with other
                            browsers might see. They would still get the same content, and that's the
                            important thing.

                            Hopefully, Microsoft will rectify some of the problems with the next
                            release of IE. Then again, probably not...
                            [color=blue][color=green]
                            >> A dumping ground for things I might want to show or store on-line. There
                            >> is no home page: I can never think of useful or interesting things to
                            >> post.[/color]
                            >
                            > Why you sad lonely person. ;-][/color]

                            Uh huh. *rolls eyes*
                            [color=blue]
                            > You must have hobbies or something. I of course have my business, but
                            > I have been thinking for a while about making a site for my Charmed
                            > (the series) items.[/color]

                            Plenty: sports, books, PC games, music (playing, in addition to
                            listening), programming (I know far more than just JS), films - enough to
                            fill 20 sites. However, writing a personal site for me is like writing a
                            story; something I've never been good at. It's just not where my creative
                            side lies.

                            Mike

                            --
                            Michael Winter
                            M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

                            Comment

                            • Cardman

                              #44
                              Re: Some unknown browsers fail to calculate my JavaScript code.

                              On Tue, 03 Feb 2004 10:10:45 GMT, Michael Winter
                              <M.Winter@bluey onder.co.invali d> wrote:
                              [color=blue]
                              >If CSS is disabled or overridden (users can specify their own style sheets
                              >if they wish), the flags still appear at the top of the page, which is a
                              >more logical location for them.[/color]

                              Yes, except as pointed out these menus should ideally line up between
                              pages, when it does not look right to see your menu drop.
                              [color=blue]
                              >I just use the W3C's CSS Specification. You'll probably want to do a lot
                              >of experimentation as using style sheets can be somewhat fiddly.
                              >
                              > http://www.w3.org/TR/CSS2/[/color]

                              Ok, I will take a good look at it.
                              [color=blue]
                              >Only CSS 1 and 2 are viable at the moment. As you've already seen, the
                              >World's most used browser can barely manage CSS 2, so 2.1 and 3 aren't
                              >really of much use yet. 2.1 and 3 aren't finished yet, anyway.[/color]

                              I will keep that in mind. So how well do other browsers deal with
                              CSS2?
                              [color=blue][color=green][color=darkred]
                              >>> The text size can be changed extremely easily (changing a "font-size:
                              >>> 80%"
                              >>> string to "font-size: 90%", for example).[/color]
                              >>
                              >> Somewhere around 120 to 150 sounds about right.[/color]
                              >
                              >The font size is relative to that of the main page text. Unless you want
                              >the menu to be more prominent than the content, 100% would be the maximum.[/color]

                              Yes, I would want that, when the menu certainly has to stand out. I
                              have seen sites before where I have spent a long time finding the link
                              I need because their pages are cluttered and this menu option is just
                              a small text link placed somewhere.
                              [color=blue][color=green]
                              >> Well my sections are divided into two around the title, one following
                              >> the page description, as many as it takes to separate items, then one
                              >> at the base of the page.[/color]
                              >
                              >The basic approach would be to place each item in a DIV with class "item",
                              >say, then specify rules for them and the title (H1, id="title") that adds
                              >the borders.[/color]

                              I have little understanding of what exactly has to be done, but from
                              your comments I should be able to figure it out quickly when I come to
                              do it.
                              [color=blue][color=green]
                              >> True, but that is another one of those undesirable restructuring my
                              >> site things. As even something like changing my page format to this
                              >> new system could well take months.
                              >>
                              >> I am a busy person...[/color]
                              >
                              >Even if you resort to copy and paste, it should only take a couple of
                              >hours.[/color]

                              The whole site? I would put that down at about a week of hard work
                              just to convert all the pages.
                              [color=blue][color=green]
                              >> This time it is not a retrieval speed issue, but one you would know if
                              >> you try to manually update a complex menu on 78 pages, while at the
                              >> same time you have other pressing matters to attend to.[/color]
                              >
                              >You seem to be approaching this update thing with the idea that it has to
                              >be started and finished in the same day. Why?[/color]

                              The main reason is that I always have work to do, where anything
                              non-vital when put aside tends to get left there. So if it is not
                              completed in the single session, then it can take a very long time
                              before the next session comes around.
                              [color=blue]
                              >The approach I take is to replicate the website on my hard disk (including
                              >directory structure) and work on that. Once it's finished, I upload it all
                              >in one go, closing the site first with a dummy front page and uploading
                              >the new one last.[/color]

                              A better idea is to change your pages names, when you can upload all
                              the new pages, then just swap in the new index page to have the whole
                              site swap over in a second or two.

                              The old pages should be removed within 24 hours to remove
                              compatibility issues with the old and new sites.
                              [color=blue]
                              >If you needed to, you could take a year to rewrite the
                              >site and keep the current one active until it's finished. The only thorn
                              >in your side would be having to keep the current site up-to-date.[/color]

                              I once had my old site translated to Swedish by a helpful person,
                              where it was always a problem when I updated the information.
                              [color=blue][color=green]
                              >> Yes, not unlike what I had before. Copy, open the file, scroll down,
                              >> delete the menu, paste the new menu, edit if needed, copy if needed,
                              >> save the file, close the file.[/color]
                              >
                              >Never heard of "Find and Replace"?[/color]

                              Since the menu is near the top of the file, then there is really no
                              need, when you know how far down it is. Also search and replace only
                              deals with single lines and not a whole (don't forget variable) menu.
                              [color=blue][color=green]
                              >> The world's most popular browser is crap...[/color]
                              >
                              >It's vulnerable to security exploits,[/color]

                              No doubt many browsers have such issues, where hackers prefer to
                              exploit the one that the most people are using.
                              [color=blue]
                              >slow,[/color]

                              Seems fast enough to me.
                              [color=blue]
                              >error prone,[/color]

                              I cannot say that I have seen errors, when my only real issue is that
                              box size and number of letters that will fit in that input box do not
                              match.
                              [color=blue]
                              >unstable,[/color]

                              No such problem here.
                              [color=blue]
                              >and can't manage to implement even basic standards properly that are
                              >several *years* older than itself.[/color]

                              Ever complained to Microsoft about this?
                              [color=blue][color=green]
                              >> It may be crap, not that it seems too crap to me, but it would not be
                              >> the best idea to ignore it.[/color]
                              >
                              >I wouldn't ignore it, but I wouldn't spend too much time making it work
                              >with everything.[/color]

                              So it begins that I should deal with the 1% of people who cannot use
                              JavaScript, but now to ignore 100% compatibility with the most used
                              browser around?
                              [color=blue]
                              >Users could still easily navigate the site, but they
                              >wouldn't see all of the presentation elements that users with other
                              >browsers might see. They would still get the same content, and that's the
                              >important thing.[/color]

                              In my business I have learned one valuable lesson, which is that
                              appearance is equal to or even exceeding content.

                              For example, even though I completely describe items beyond what any
                              other supplier would, but my items simply do not sell unless I put a
                              photo of this item on the site first.

                              One picture is worth a thousand words you could say, where lets
                              imagine how much difference it would make between a good and bad
                              looking/functional site?

                              That is why I consider the menu to be a very important aspect, when
                              this is basically the control system for the whole site. Things not
                              working here is just not a viable option.
                              [color=blue]
                              >Hopefully, Microsoft will rectify some of the problems with the next
                              >release of IE. Then again, probably not...[/color]

                              You could always point this problem out to them.
                              [color=blue]
                              >Plenty: sports, books,[/color]

                              Oh? What books? I am into sci-fi/fantasy myself.
                              [color=blue]
                              >PC games,[/color]

                              I wish I had time for PC games, but I still have games from previous
                              birthdays currently unplayed. The last real game I played was Ultima
                              8, when that first came out, where you can tell that it has been a
                              long time.

                              I do play the odd quick game now and again, like a level of the
                              original Settlers or an odd program called Morkin.
                              [color=blue]
                              >music (playing, in addition to listening),[/color]

                              I don't play too much music these days, when I prefer music videos.
                              [color=blue]
                              >programming (I know far more than just JS),[/color]

                              Yes, most people do. I have used so many languages now that I would
                              take me quite some time to recall them all.
                              [color=blue]
                              >films - enough to fill 20 sites.[/color]

                              Movies are one of my popular past times as well, which is why here I
                              have a 61" rear projection TV and DD5.1 sound system. My own home
                              cinema, but I plan to add DTS support one day soon.
                              [color=blue]
                              >However, writing a personal site for me is like writing a
                              >story; something I've never been good at. It's just not where my creative
                              >side lies.[/color]

                              Sounds like a computer programmer to me. :-]

                              One of my worst subjects at school was English, even if I read a whole
                              load of books, where as even my art lessons where not good, then my
                              artistic side was lacking.

                              However, although my English has now improved a lot, but I can do
                              great things by a different method. That method is through
                              mathematical precision.

                              That is where computers can prove very useful, when my artistically
                              clumsy hands can type well enough. And so through computers I can work
                              on achieving visual perfection.

                              It always seems that there is only one correct answer, where the work
                              done it simply working to achieve that goal. And so my whole site is
                              built with the aim of bringing everything together in a way that
                              works.

                              What I am doing today though is to split my Order Forms into two, when
                              before hand my brother created them (when he added PHP section) so
                              that my Order Form submitted the contents to itself for final PHP
                              processing.

                              I always though that was wrong, which is why my test today has just
                              successfully broke my Order Form into two files. In one is the pure
                              HTML and JavaScript code of my Order Form, where in the second file is
                              all the PHP code for on-line order processing.

                              Technically this Order Form section does not need to be a PHP3 file
                              now, but since I will soon add PHP processing to this code, then that
                              is why I left it that way for now.

                              Since I have one order forms to each currency, making three in total,
                              then I should now be able to combine the PHP code from them (well one)
                              in order to make the one online order processing file.

                              That would be good news, when in the future I should be able to
                              replace my orders forms as the method used to submit this data, which
                              is the step towards having a shopping basket system.

                              I do not predict any problems from this simple code split, but I will
                              test it with different browsers just to make sure.

                              Cardman


                              Comment

                              • Cardman

                                #45
                                Re: Some unknown browsers fail to calculate my JavaScript code.

                                On Tue, 03 Feb 2004 10:04:07 +0100, Bas Cost Budde <bas@heuveltop. org>
                                wrote:
                                [color=blue]
                                >AFAIK the Euro procedure is that you have to perform all intermediate
                                >(euro!) calculations with four decimals precision, and may round the
                                >result only (two decimals).[/color]

                                Yes, it should do that, when exchange rates have four decimal places.

                                Since all values are calculated in Sterling, then they are transferred
                                to Euros at the published currency rates, where the four digit result
                                is then rounded to two digits.
                                [color=blue]
                                >If/when the calculation is using pound sterling, that procedure doesn't
                                >apply.[/color]

                                It does the calculation in Sterling, but the Euro values still works
                                on four digits before rounding.
                                [color=blue]
                                >I think you round in the end, Cardman?[/color]

                                All values are rounded, except for the VAT value that is floored to
                                save my customers 1p. As allowed by Customs and Excise.
                                [color=blue]
                                >Who cares what you did before?[/color]

                                The problem with my Euro Order Form is that the values do not add up,
                                even if all the values are totally correct. After all I would need to
                                display four decimal places instead of two in order to show that the
                                values do add up.
                                [color=blue]
                                >I get some value with two decimal positions, convert by using my
                                >six digit conversion factor, display the euro amount.[/color]

                                Just what do you get six digit exchange rates from?
                                [color=blue]
                                >You shouldn't, of course, convert every intermediate result to euro, add
                                >those up, and then get upset about missing 100ths. At least they always
                                >taught me "don't round (convert!) your intermediate results!"[/color]

                                No I don't do that.

                                I have been thinking about going back over the sub-values and slightly
                                adjusting them so that they add up to the total, but then that only
                                goes and creates other issues.

                                Cardman


                                Comment

                                Working...