Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 38
  1. #16
    Regular Coder
    Join Date
    Sep 2011
    Posts
    343
    Thanks
    3
    Thanked 37 Times in 37 Posts
    Those examples don't count, because they are nothing more than your word (site) against theirs. (I should have put forward this argument in my previous post.) You could still very well be the unreasonable fundamentalist that advocates techniques that have no added practical value and they the pragmatic party that offers comprehensible tutorials.

    I need proof coming from a neutral party. With examples that clearly show that the javascripts on W3Schools are not rendered correctly by the modern browsers, as you keep inferring.

    And folks should take into consideration that W3Schools *does* keep up with developments. That is shown by the HTML5 section, which was launched soon after the official release by W3.org. The fact they have not reverted yet to strict javascript is most probably because that offers no practical benefits, only makes things substantially more complicated.
    Last edited by Frankie; 05-28-2013 at 01:13 PM.

  2. #17
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,865
    Thanks
    6
    Thanked 1,029 Times in 1,002 Posts
    Quote Originally Posted by Frankie View Post
    That is shown by the HTML5 section, which was launched soon after the official release by W3.org.
    Just FYI: HTML 5 isn’t even officially released as standard, it’s merely a candidate recommendation. It’s only being used negligently by a lot of early adopters (and those that don’t know any better) that add a lot of additional workarounds and “polyfills” to make it seemingly work in older browsers. And then the inventors don’t dare to change features anymore because people already rely on them when they actually should have waited for the final implementation. This behavior (which you call “practical”) is also the reason why Internet Explorer stuck to its own proprietary code so long, because a lot of “practical” people used that non-standard code and Microsoft didn’t dare to break with the backwards compatibility for the fear of losing market share when websites wouldn’t work in IE anymore. This is also why the tag soup called “HTML 5” is still around when we could be at XHTML 2 already if reason had prevailed over negligent “practicality”.

    The same goes for JavaScript (or Jscript, as Microsoft called its own version) where promoting old code and coding practices isn’t helping anyone except those that are too lazy to write clean code. Yes, it might be quicker on first sight but takes a lot longer to maintain in the long run. That old code still works in modern browsers doesn’t mean that it’s wise to use it.

  3. #18
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by Frankie View Post
    I need proof coming from a neutral party.
    Feed the examples through http:jslint.com and see which ones give warnings about the code.

    All the pages I pointed out as outdated at w3schools give warnings about the code if you feed them through that site (and that site was written by one of the people who helped create JavaScript).

    You might also read the JavaScript standards.

    As another example the actual standards list the command covered at http://www.w3schools.com/jsref/jsref_substr.asp as obsolete and not to be used.
    Last edited by felgall; 05-28-2013 at 09:34 PM.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  4. #19
    Regular Coder
    Join Date
    Sep 2011
    Posts
    343
    Thanks
    3
    Thanked 37 Times in 37 Posts
    Quote Originally Posted by felgall View Post
    Feed the examples through http:jslint.com and see which ones give warnings about the code.
    I did, but already the result of the first one proved that jslint.com was written by the same kind of fundamentalists. This is what I entered:
    Code:
    function displayDate()
    {
    document.getElementById("demo").innerHTML=Date();
    }
    and these were the comments jslint.com had:
    Expected exactly one space between ')' and '{'.

    Missing 'use strict' statement.
    document.getElementById("demo").innerHTML=Date();

    Missing space between 'innerHTML' and '='.
    document.getElementById("demo").innerHTML=Date();

    Missing space between '=' and 'Date'.
    document.getElementById("demo").innerHTML=Date();

    Expected '}' at column 5, not column 1.
    Not only are they now telling us how to format our code, which has no bearing on the functionality whatsoever, they are acting extremely unreasonable by applying strict judgment rules to non-strict code. That would the same as the W3 Validator disapproving HTML4 code with an HTML4 doctype over it because it isn't HTML5! Which would be idiotic! And I already explained that in a previous post, so it is now clear that you have completely run out of valid arguments.

    Quote Originally Posted by felgall View Post
    As another example the actual standards list the command covered at http://www.w3schools.com/jsref/jsref_substr.asp as obsolete and not to be used.
    One non-fatal code snippet that works perfectly well in all modern browsers?? You're only proving my point further: the whole criticism of W3Schools is based on the scrutiny by a couple of unreasonable fundamentalists. Who are advocating methods that currently have no practical value whatsoever, but that do cause problems with the backward compatibility!
    Last edited by Frankie; 05-29-2013 at 06:08 AM.

  5. #20
    New Coder
    Join Date
    Feb 2013
    Location
    Liverpool
    Posts
    70
    Thanks
    1
    Thanked 4 Times in 4 Posts
    If this post still wants an original answer - then a basic explanation could be to do this:

    1) Use Javascript easily with your HTML by adding something as basic as:

    Code:
    <script text="text/javascript">
    alert("hello");
    </script>
    Into your <head> section. This is a very basic example of javascript and it will work out the box. Use sites such as w3schools or whatever to find examples of other javascript examples you can try.

    2) You could even use jquery if you want to do something more complex - you will need to include a reference to the jquery library such as:

    Code:
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
    Put this in your <head> section too. Then to execute some simple code you can do this:

    Code:
    <script text="text/javascript">
    $(document).ready(function() {
    alert("hello");
    });
    </script>
    Tell me if it's useful or not would love to know what you did
    Last edited by edgethreesixty; 05-29-2013 at 11:24 AM.
    Working for Edge Three Sixty doing Drupal Development

  6. #21
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,865
    Thanks
    6
    Thanked 1,029 Times in 1,002 Posts
    Quote Originally Posted by edgethreesixty View Post
    2) You could even use jquery if you want to do something more complex […]
    Honestly, if someone doesn’t even know how to include JavaScript in their HTML code then it’s the third step before the second to tell them to use jQuery. Before using JS libraries they should at least understand the basic concepts of JS and web development in general.

  7. #22
    New Coder
    Join Date
    Feb 2013
    Location
    Liverpool
    Posts
    70
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Hence why I gave him the information on how to use basic javascript first
    Working for Edge Three Sixty doing Drupal Development

  8. #23
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by Frankie View Post
    I did, but already the result of the first one proved that jslint.com was written by the same kind of fundamentalists.
    JSlint was written by one of the people who created JavaScript

    Quote Originally Posted by Frankie View Post
    One non-fatal code snippet that works perfectly well in all modern browsers?
    It was one example of where the JavaScript STANDARDS say not to use that command any more - basically because it doesn't work in all modern browsers - some versions of IE still in popular use will fail with substr(-1,1)

    If you can't accept what the JavaScript standards and the people who created JavaScript say about how to use JavaScript then there is no point in further discussion as what you are talking about is NOT JavaScript.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  9. #24
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by edgethreesixty View Post
    Use sites such as w3schools or whatever to find examples of other javascript examples you can try.
    If you had read this thread you would see that w3schools has been clearly demonstrated to be somewhere NOT to go to learn JavaScript - unless your audience is still using Netscape 4 and earlier.

    You would have also seen that alert should only ever be used for debugging.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  10. #25
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Official JavaScript standards - http://www.ecma-international.org/ecma-262/5.1/

    JavaScript validator (written by one of the people who is responsible for creating JavaScript) - http://jalint.com

    JavaScript tutorial site written by the person who wrote the JavaScript content for About.com for seven years (while it was owned by the New York Times) - http://javascriptexample.net

    Antiquated JavaScript site written by two guys from Norway with no connection to any of the above or anything else relating to JavaScript - http://w3schools.com


    Which of these four would you trust as a source for how JavaScript should be written? Note that the first three all agree in what is and isn't valid JavaScript while the fourth of these promotes many obsolete and antiquated code constructs that are known to cause lots of problems and which the first three of these tell you not to use.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  11. #26
    Regular Coder
    Join Date
    Sep 2011
    Posts
    343
    Thanks
    3
    Thanked 37 Times in 37 Posts
    Quote Originally Posted by felgall View Post
    It was one example of where the JavaScript STANDARDS say not to use that command any more - basically because it doesn't work in all modern browsers - some versions of IE still in popular use will fail with substr(-1,1)
    Bull****! Works perfectly fine in IE7-9! (10 not tested, but that is not what you could have meant with "versions of IE still in popular use".)

    Furthermore, the history books are full of people who founded or otherwise created something or who at one time held high positions, but who later clearly lost all contact with reality, turned unreasonable fundamentalists.

    And the fact that you have not been able to uphold your arguments and are now reverting to historical achievements, positions or titles is the final proof for any objective reader that you have no valid arguments.
    Last edited by Frankie; 05-30-2013 at 03:01 AM.
    Frank

    How to: Target IE in, Position in, Center in, Create a Fixed ('Sticky') Footer with, and Create a Drop-Down/Fly-Out Menu with CSS: Website Laten Maken Amsterdam.

  12. #27
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by Frankie View Post
    And the fact that you have not been able to uphold your arguments and are now reverting to historical achievements, positions or titles is the final proof for any objective reader that you have no valid arguments.
    What utter garbage. The first of those links I referenced is THE JAVASCRIPT STANDARD - that's where JavaScript is defined.

    If you don't believe in the JavaScipt standard then what you are producing will never be JavaScript - the standard is the supreme authority on what is and isn't JavaScript - NOT YOU.

    The second and third sites I listed both comply with the standard, the w3schools site doesn't. Therefore what the w3schools site has listed as JavaScript should not really be labelled that way as it isn't JavaScript becauzs it contradicts the standard.

    Anything that doesn't comply with http://www.ecma-international.org/ecma-262/5.1/ I(S NOT AND NEVER CAN BE JavaScript - that some browsers can understand some garbage until such time as you add something to the page that breaks it is just browsers trying to be forgiving of the garbage that some people write in place of JavaScript.

    Having clearly demonstrated that what you are talking about is NOT JavaScript I see little point in continuing this discussion. Anyone writing JavaScript should do so in accordance with the standards. Anyone following the tutorials at w3schools is not writing JavaScript even though browsers may be able to interpret their mess as such until such time as they add more code to the page and their garbage breaks.
    Last edited by felgall; 05-30-2013 at 04:10 AM.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  13. #28
    Regular Coder
    Join Date
    Sep 2011
    Posts
    343
    Thanks
    3
    Thanked 37 Times in 37 Posts
    Quote Originally Posted by felgall View Post
    Anything that doesn't comply with http://www.ecma-international.org/ecma-262/5.1/ I(S NOT AND NEVER CAN BE JavaScript - that some browsers can understand some garbage until such time as you add something to the page that breaks it is just browsers trying to be forgiving of the garbage that some people write in place of JavaScript.

    Having clearly demonstrated that what you are talking about is NOT JavaScript I see little point in continuing this discussion. Anyone writing JavaScript should do so in accordance with the standards. Anyone following the tutorials at w3schools is not writing JavaScript even though browsers may be able to interpret their mess as such until such time as they add more code to the page and their garbage breaks.
    That first statement is a load of bull**** as well! In section 10.1.1, the ECMA Specification says:
    An ECMAScript Program syntactic unit may be processed using either unrestricted or strict mode syntax and semantics.
    Folks have the choice! And so they should, because modern browsers render traditional javascript perfectly well, and will continue to do so forever and ever. They cannot afford not to, because that would mean a lack of backward compatibility.

    For that exact same reason HTML3 is still, and will always be, rendered perfectly well, as long as you put the right doctype over it (= equivalent to not putting "use strict" in the non-strict-javascript block). And even Firebug finds no errors in javascripts by W3Schools. YOU HAVE NO VALID ARGUMENTS! End of discussion.
    Last edited by Frankie; 05-30-2013 at 06:08 AM.

  14. #29
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by Frankie View Post
    End of discussion.
    You seem to be under the misunderstanding that I was discussing something with you. We were simply presenting opposing cases so that those not yet committed to antiquated or modern JavaScript have a bit more information to help them choose between the two.

    You have now concluded presenting my case for me so that I have nothing more that I need to add.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  15. #30
    New Coder
    Join Date
    Feb 2013
    Location
    Liverpool
    Posts
    70
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by felgall View Post
    You would have also seen that alert should only ever be used for debugging.
    He's asking for basic Javascript examples - you need to get off your high horse and just get the guy onto the right path for learning JS himself/herself and let them find out this information to themselves.

    If I was web developer asking for help and I'd read the posts on here I think I'd be put off for life in all honesty. The guys asked for simple help and you've took it upon yourselves to take over his thread by arguing semantics it's quite pathetic.

    Hope you get on the right track anyway if you're still reading this boring thread
    Working for Edge Three Sixty doing Drupal Development


 
Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •