JS Guru needed! Why doesn't this work?

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

    JS Guru needed! Why doesn't this work?

    My pages need to unfold gracefully even if Javascript is disabled, but
    I can't get this to work?

    Please help, Javascript Gurus!!

    <noscript>
    document.write( '<span class=warning>< b>Warning</b>: You must enable
    javascript for this page to work properly!</span>')
    </noscript>

    Thanks so much,
    Ann

  • antoine.viau@gmail.com

    #2
    Re: JS Guru needed! Why doesn't this work?

    There is some paradox in your code...
    If Javascript is disabled (or unavailable on "really old" browser), it
    means it cannot execute any kind of JS.
    And you're asking to execute some JS when there is no JS.uh ? :-)
    Means :
    <noscript>
    <span class=warning>W arning, you must...</span>
    </noscript>

    Antoine

    Comment

    • Randy Webb

      #3
      Re: JS Guru needed! Why doesn't this work?

      Giggle Girl said the following on 11/21/2005 10:30 AM:[color=blue]
      > My pages need to unfold gracefully even if Javascript is disabled, but
      > I can't get this to work?
      >
      > Please help, Javascript Gurus!!
      >
      > <noscript>
      > document.write( '<span class=warning>< b>Warning</b>: You must enable
      > javascript for this page to work properly!</span>')
      > </noscript>[/color]

      <noscript>
      <span class="warning" >I do not have a clue how to make my page work with
      javascript disabled so you must come back with a script enabled browser
      to see a page that probably isn't worth seeing to start with</span>
      </noscript>

      --
      Randy
      comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
      Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

      Comment

      • VK

        #4
        Re: JS Guru needed! Why doesn't this work?


        Randy Webb wrote:[color=blue]
        > <noscript>
        > <span class="warning" >I do not have a clue how to make my page work with
        > javascript disabled so you must come back with a script enabled browser
        > to see a page that probably isn't worth seeing to start with</span>
        > </noscript>[/color]

        <noscript>
        <span class="warning" >
        My web application is based heavily on JavaScript. I have no idea why
        did you turn JavaScript off, but you have to turn it on again to use my
        application. I personally have no intention to make two equivalent
        versions of my application: one for normal visitors, other one for few
        dumb a** like you. Othervise what use JavaScript at all? So I'm affraid
        this is your step to make.
        </span>
        </noscript>

        I dend to believe that this warning text is much better.

        Comment

        • Michael Winter

          #5
          Re: JS Guru needed! Why doesn't this work?

          On 21/11/2005 17:40, VK wrote:

          [snip]
          [color=blue]
          > I personally have no intention to make two equivalent versions of my
          > application: one for normal visitors, other one for few dumb a** like
          > you.[/color]

          Has it occurred to you that you're the only regular poster to this group
          that actually believes that two versions would be necessary? Another
          situation where you're right, and everyone else is wrong, perhaps?

          You made a similar statement about a month ago, and I tried to explain
          that it was nonsense then, too. Evidentially, the notion of graceful
          degradation hasn't sunk in yet.

          [snip]
          [color=blue]
          > I dend to believe that this warning text is much better.[/color]

          You are clearly beyond help. It's a shame, but a situation that I,
          personally, am tired of dealing with.

          --
          Michael Winter
          Prefix subject with [News] before replying by e-mail.

          Comment

          • VK

            #6
            Re: JS Guru needed! Why doesn't this work?


            Michael Winter wrote:[color=blue]
            > Has it occurred to you that you're the only regular poster to this group
            > that actually believes that two versions would be necessary? Another
            > situation where you're right, and everyone else is wrong, perhaps?[/color]

            Dear Michael,

            First of all let me make it clear that "dumb a**" in my previous post
            was totally in the context of that humorous address to some user with
            JavaScript disabled and it was not anyhow addressed to the post
            readers. I believe it is rather clear but I'd like to make it even more
            clear.

            Secondly the statement that any page has to be functional with or
            without JavaScript is indeed completely false and is not covered by the
            "fall gracefully" requirement. The page should not crash the browser
            and user should be always informed that some or all of the page
            functionality is currently not available. This is all.

            I cannot think of any situations when the page with JS enabled would
            provide the same or comparable user experience as the same page without
            JS enabled. Maybe only some really primitive form helpers (like setting
            focus to the first form field).

            But I can think of many famous and prospering web services which are
            not functional w/o client-side scripting.

            And some services (like Google Maps and Google Suggests) *are not
            reproducible* by server-side-only solutions. They need either
            client-side scripting or stay-alone application.

            So yes, I know that a lot of people would like to see JavaScript /
            JScript on its 10-years old place: as a toy which is nice to have but
            OK to leave without. There are also some people who would like to keep
            historical Books Of ECMA as all explaining source of information
            forever.

            They may want to think again what year is now and visit
            <http://www.w3.org/2006/webapi/>

            P.S. I see a new urban legend is growing here recently (I traced it
            back to one a month old post):-
            about JavaScript disabled in corporate environment for security
            measures.

            Personally (so not *officially*) in 5 years spent so far in the Bay
            Area plus daily visits to San Jose I did not see one damn user with
            disabled JavaScript/JScript. I also did not see yet one network admin
            who would disable JavaScript as a *valid security measure*. That alone
            would suffice to feel free to fire his a**, as a person who has no clue
            what the security is about and how to handle it.

            Comment

            • VK

              #7
              Re: JS Guru needed! Why doesn't this work?


              VK wrote:[color=blue]
              > I cannot think of any situations when the page with JS enabled would
              > provide the same or comparable user experience as the same page without
              > JS enabled.[/color]

              A metathese obviously :-)
              Must be:

              I cannot think of any situations when the page with JS disabled would
              provide the same or comparable user experience as the same page with JS
              enabled.

              Comment

              • VK

                #8
                Re: JS Guru needed! Why doesn't this work?

                Just another 2 minutes fresh sample of what I'm saying:

                <http://groups.google.c om/group/comp.lang.javas cript/browse_frm/thread/c5b2b99752d293d 1/228d5767a24608b 6#228d5767a2460 8b6>

                "you can't do this, it's server-side only"
                "you can't do that, it's application only"

                Big surprises are coming though... ;-)

                Comment

                • Michael Winter

                  #9
                  Re: JS Guru needed! Why doesn't this work?

                  On 21/11/2005 20:05, VK wrote:

                  [snip]
                  [color=blue]
                  > Secondly the statement that any page has to be functional with or
                  > without JavaScript is indeed completely false[/color]

                  Would you care to venture a reason for why you think that is? Is that an
                  absolute statement on your part, or is there a hidden qualifier you
                  neglected to mention?
                  [color=blue]
                  > and is not covered by the "fall gracefully" requirement.[/color]

                  Yes, it is. By my definition, anyway, and the definition often (always?)
                  used in this group.
                  [color=blue]
                  > The page should not crash the browser[/color]

                  That isn't a consequence of designing for graceful degradation, that's
                  just competency.
                  [color=blue]
                  > and user should be always informed that some or all of the page
                  > functionality is currently not available.[/color]

                  That isn't graceful. That's unmitigated failure.
                  [color=blue]
                  > [I cannot think of any situations when the page with JS disabled
                  > would provide the same or comparable user experience as the same page
                  > with JS enabled.][/color]

                  Care to define "comparable user experience", and give an example
                  situation? As far as I know, "user experience" encompasses a few
                  qualities together: appearance, content, functionality, and usability.
                  If you can't think of any situations where the server cannot provide a
                  comparable experience, you mustn't be trying hard enough. The approach
                  taken will almost certainly be different and may even need to be broken
                  down into separate stages.

                  Not everything can be reproduced, but not everything needs to be.
                  [color=blue]
                  > But I can think of many famous and prospering web services which are
                  > not functional w/o client-side scripting.[/color]

                  Good for them. Doesn't mean it's the right approach to take. If you
                  explained that the same thing could be provided to everyone, rather than
                  excluding some users (and potential income), I'd expect management would
                  agree, too.
                  [color=blue]
                  > And some services (like Google Maps and Google Suggests) *are not
                  > reproducible* by server-side-only solutions.[/color]

                  Google Maps certainly can be. Movement of the map will be limited to
                  jumps using the controls to the top-left rather than dragging, but the
                  experience (as defined above) will be the same.

                  Google Suggests can't be, but that's one of those things that doesn't
                  need to be. I, and millions of others, have managed to use Google
                  without an auto-complete feature for years, so if Google Search
                  implemented this by default, it wouldn't matter if it was used or not as
                  long as the original behaviour was maintained.

                  [snip]
                  [color=blue]
                  > They may want to think again what year is now and visit
                  > <http://www.w3.org/2006/webapi/>[/color]

                  Exactly what is the point you're trying to make? That the W3C are trying
                  to standardise some de facto and proprietary features? So what? That
                  doesn't mean that all users must suddenly switch to a browser that
                  implements client-side scripting and must enable that feature (a
                  ridiculous notion).

                  [snip]

                  Mike

                  --
                  Michael Winter
                  Prefix subject with [News] before replying by e-mail.

                  Comment

                  • VK

                    #10
                    Re: JS Guru needed! Why doesn't this work?


                    Michael Winter wrote:[color=blue]
                    > Google Suggests can't be, but that's one of those things that doesn't
                    > need to be. I, and millions of others, have managed to use Google
                    > without an auto-complete feature for years.[/color]

                    This statement alone shows the difference in our *positions* over this
                    question and their hardware incompatibility which no discussion may
                    remove.

                    I just wondering why did you limit yourselve by *millions* of people
                    who managed to live w/o Google Suggests?

                    Not so long ago *billions* of people managed to live w/o Internet and
                    the world did not crash because of it.

                    Comment

                    • Randy Webb

                      #11
                      Re: JS Guru needed! Why doesn't this work?

                      VK said the following on 11/21/2005 12:40 PM:[color=blue]
                      > Randy Webb wrote:
                      >[color=green]
                      >><noscript>
                      >><span class="warning" >I do not have a clue how to make my page work with
                      >>javascript disabled so you must come back with a script enabled browser
                      >>to see a page that probably isn't worth seeing to start with</span>
                      >></noscript>[/color]
                      >
                      >
                      > <noscript>
                      > <span class="warning" >
                      > My web application is based heavily on JavaScript. I have no idea why
                      > did you turn JavaScript off, but you have to turn it on again to use my
                      > application. I personally have no intention to make two equivalent
                      > versions of my application: one for normal visitors, other one for few
                      > dumb a** like you. Othervise what use JavaScript at all? So I'm affraid
                      > this is your step to make.
                      > </span>
                      > </noscript>
                      >
                      > I dend to believe that this warning text is much better.[/color]

                      Nothing wrong with having a JS heavy web-app. Just make it so that
                      non-JS doesn't get to it without some direction action from the user.

                      The problem with this part of your statement:

                      <quote>
                      I personally have no intention to make two equivalent versions of my
                      application: one for normal visitors, other one for few dumb a** like you.
                      </quote>

                      Is that you still seem to think you have to make 2 versions of
                      everything when you don't.

                      But, if you will tell me how to enable Javascript on my non-JS Cell
                      Phone Browser that is under 3 months old, you may have a chance of
                      changing my mind about non-JS browsers.

                      And my cell phone is not the only place where you may run into non-JS
                      browsers where the user can't change the settings.

                      Second:
                      If you have to ask "Otherwise what use is Javascript at all", then you
                      shouldn't be using Javascript to start with.

                      --
                      Randy
                      comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
                      Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

                      Comment

                      • VK

                        #12
                        Re: JS Guru needed! Why doesn't this work?


                        Randy Webb wrote:[color=blue]
                        > The problem with this part of your statement:
                        > <quote>
                        > I personally have no intention to make two equivalent versions of my
                        > application: one for normal visitors, other one for few dumb a** like you.
                        > </quote>
                        > Is that you still seem to think you have to make 2 versions of
                        > everything when you don't.[/color]

                        Then I must be missing the ability to read between the lines, because
                        the statement which caused my polemics was:

                        <quote>
                        I do not have a clue how to ***make my page work with
                        javascript disabled*** so you must come back with a script enabled
                        browser
                        to see a page that probably isn't worth seeing to start with
                        </quote>

                        By reading it in the conventional English I understand it as: "My page
                        cannot work == produce the intended user experience without JavaScript
                        enabled. I am a bad developer."

                        This leads me to a conclusion that any web solution has to be endorsed
                        first by a fully equivalent server-side solution (in case if the
                        scripting is disabled). And only then you may start to develope a
                        client-side based equivalent.

                        This leads me to the question why bother at all to make a client-side
                        solution is you already have a server-side one?

                        This leads me to the conclusion that besides some really primitive form
                        helpers client-side scripting should be avoided at all.

                        Please mark the logical failure in this sequence (if any).

                        My personal position is that client-side scripting is not anymore an
                        add-on to the browsing experince. It is an integral part of such
                        experience like online forms or graphics support. You can disable
                        JavaScript if you really want. You can disable form submission,
                        graphics support, CSS support, SSL support, install MS-DOS version of
                        Lynx, make your own browser etc. etc.
                        This is your freedom of choice, *but* you shouldn't bother anyone else
                        with your freedom issues as well as anyone should be bothered with your
                        ideas of self-expression.

                        You want to drive - you need a car. You want to play Quake - you need a
                        computer. You want to get an adequate browsing experience - you have to
                        use a standard compliant browser or IE with reasonnable security
                        settings. You want an omlet - you have to break the eggs.
                        [color=blue]
                        > But, if you will tell me how to enable Javascript on my non-JS Cell
                        > Phone Browser that is under 3 months old, you may have a chance of
                        > changing my mind about non-JS browsers.[/color]

                        PDA and cellphones are all different issue. The current slogan "Get the
                        same pages in the same way in your cellphone" is a pure propaganda from
                        cellphone producers. It is called "aggressive advertisement" ;-)
                        Many web-portals are getting slow on my test laptop 260MGz / 96Mb The
                        idea that anyone may manage to have full and quick emulation of say IE
                        6.0 on a low-energy ARMS processor with 32/64 Mb available is ...
                        non-adequate.
                        It's all the question of the crutial mass. As soon as it was reached
                        for GPRS cellphones, WML language and WML site development became
                        requested. Now any respectable web-service has a WML mirror.
                        Then the crucial mass of new generation of web-phones will be reached,
                        a scaled down, cell-phone adjusted HTML/XML version will become a must
                        either.

                        You personally just paying the price of being between the first users
                        of a new software / hardware. They are always paying the highest price
                        and they are getting all bugs, products recalls and other setup
                        troubles ;-)

                        Comment

                        • Steven Daedelus

                          #13
                          Re: JS Guru needed! Why doesn't this work?

                          On Mon, 21 Nov 2005 13:48:06 -0500, Michael Winter wrote
                          (in article <GDogf.12965$Lw 5.5945@text.new s.blueyonder.co .uk>):
                          [color=blue]
                          > On 21/11/2005 17:40, VK wrote:
                          >
                          > [snip]
                          >[color=green]
                          >> I personally have no intention to make two equivalent versions of my
                          >> application: one for normal visitors, other one for few dumb a** like
                          >> you.[/color]
                          >
                          > Has it occurred to you that you're the only regular poster to this group
                          > that actually believes that two versions would be necessary? Another
                          > situation where you're right, and everyone else is wrong, perhaps?
                          >
                          > You made a similar statement about a month ago, and I tried to explain
                          > that it was nonsense then, too. Evidentially, the notion of graceful
                          > degradation hasn't sunk in yet.
                          >
                          > [snip]
                          >[color=green]
                          >> I dend to believe that this warning text is much better.[/color]
                          >
                          > You are clearly beyond help. It's a shame, but a situation that I,
                          > personally, am tired of dealing with.
                          >
                          >[/color]

                          Not too tired to snipe, however.

                          Comment

                          • Richard Cornford

                            #14
                            Re: JS Guru needed! Why doesn't this work?

                            VK wrote:
                            <snip>[color=blue]
                            > <quote>
                            > I do not have a clue how to ***make my page work with
                            > javascript disabled*** so you must come back with a
                            > script enabled browser to see a page that probably
                            > isn't worth seeing to start with
                            > </quote>
                            >
                            > By reading it in the conventional English I understand
                            > it as: "My page cannot work == produce the intended user
                            > experience without JavaScript enabled. I am a bad developer."[/color]

                            Yes, where 'intended' means behaviour in accordance with the design and
                            sufficient for the task. Such designs are possible so it is reasonable
                            to question why that are not achieved when they are not achieved.
                            Shortcomings on the part of the developer are a reasonable hypothesis in
                            the absence of other information.
                            [color=blue]
                            > This leads me to a conclusion that any web solution has to
                            > be endorsed first by a fully equivalent server-side solution
                            > (in case if the scripting is disabled). And only then you may
                            > start to develope a client-side based equivalent.[/color]

                            You seem to have a real hang-up with doing everything twice. Doing
                            things twice is a seriously bad idea because it is inevitably expensive.
                            An integrated design with a suitably layered architecture can achieve a
                            totally reliable design with little or no extra coding time given to
                            accommodating javascript incapable/disabled browsers.
                            [color=blue]
                            > This leads me to the question why bother at all to make a
                            > client-side solution is you already have a server-side one?[/color]

                            You wouldn't be making a client side 'solution'. Whatever happens you
                            are going to need a back end of some sort to do anything worth wile so
                            all the client-side code was never going to be more than a GUI. HTML can
                            provide a workable GUI, and then client-side scripting can transform it
                            (in virtually any way imaginable).
                            [color=blue]
                            > This leads me to the conclusion that besides some really
                            > primitive form helpers client-side scripting should be
                            > avoided at all.[/color]

                            Only because you cannot understand how javascript can be used to
                            enhance, and indeed radically transform, a web page (and its GUI)
                            without introducing any dependency upon client-side scripting. See:-

                            <URL: http://www.litotes.demon.co.uk/js_info/pop_ups.html >

                            - with and without scripting enabled.
                            [color=blue]
                            > Please mark the logical failure in this sequence (if any).[/color]

                            You are looking for an excuse (any excuse) for never trying. But the
                            question is not how little can be gotten away with (a quick survey of
                            the Internet as it is will tell you that), the question of interest is
                            what can be achieved, and how it might best be achieved.
                            [color=blue]
                            > My personal position is that client-side scripting is not
                            > anymore an add-on to the browsing experince.[/color]

                            Your opinion is of little worth. Web sites, web applications and so on,
                            have a purpose. As a professional developer is would be your task to
                            know how to best achieve that purpose. Once you know and fully
                            understand what can be achieved you will find yourself in the best
                            possible position to make informed judgements about how to achieve the
                            required purpose.

                            Your position is that if the purpose cannot be achieved without
                            client-side scripting running on one or two configurations or one or two
                            browsers what meat your personal standards then you are not going to
                            even try. It is a very low standard and so relatively easy for a
                            programmer as poor as you to achieve, but it isn't necessarily in the
                            best interests of whoever may be paying you for your inferior creations.
                            [color=blue]
                            > It is an integral part of such experience like online forms
                            > or graphics support. You can disable JavaScript if you really
                            > want. You can disable form submission, graphics support, CSS
                            > support, SSL support, install MS-DOS version of Lynx, make your
                            > own browser etc. etc. This is your freedom of choice, *but*
                            > you shouldn't bother anyone else with your freedom issues as
                            > well as anyone should be bothered with your ideas of
                            > self-expression.[/color]

                            And in e-commerce how much good does it do to be laming the user for
                            your inability to take money off them.
                            [color=blue]
                            > You want to drive - you need a car. You want to play Quake -
                            > you need a computer. You want to get an adequate browsing
                            > experience - you have to use a standard compliant browser
                            > or IE with reasonnable security settings. You want an omlet
                            > - you have to break the eggs.[/color]

                            And if you want to sell things you want a shop that everyone can get
                            into. If you want to make money form advertising you want as many people
                            as possible to see those adverts, and so not only get in in the first
                            place but keep coming back. If you want a good search engine ranking you
                            want a site that can be navigated without javascript. And so on.

                            If the user, any user, can be accommodated at no additional cost or
                            effort then getting up in arms because they don't want to (or cannot)
                            use your preferred browser can only detract from the potential of a web
                            site for no good reason.
                            [color=blue][color=green]
                            >> But, if you will tell me how to enable Javascript on my
                            >> non-JS Cell Phone Browser that is under 3 months old,
                            >> you may have a chance of changing my mind about non-JS
                            >> browsers.[/color]
                            >
                            > PDA and cellphones are all different issue. The current
                            > slogan "Get the same pages in the same way in your cellphone"
                            > is a pure propaganda from cellphone producers. It is called
                            > "aggressive advertisement" ;-)[/color]
                            <snip>[color=blue]
                            > You personally just paying the price of being between the
                            > first users of a new software / hardware. They are always
                            > paying the highest price and they are getting all bugs,
                            > products recalls and other setup troubles ;-)[/color]

                            There you go again, blame the user when they suffer from your
                            incompetence and suggest people create yet another version of their web
                            site when a single version written to take advantage of the
                            interoperabilit y that has been designed into the technologies used on
                            the web is capable of accommodating small mobile devices as easily as
                            desktop browsers.

                            Richard.


                            Comment

                            Working...