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 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    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 StevenHu View Post
    I wrote an article that included a simple way to incorporate a simple footer using Javascript and innerHTML.
    It doesn't work when JavaScript is turned off!

    Also writing output using innerHTML messes things up of you need JavaScript to be able to interact with those parts of the page - so a lot of the time it will not work with JavaScript turned on.

    Including web page content should ALWAYS be done using server side processing.
    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.

  2. #17
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,927
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    Quote Originally Posted by felgall View Post
    Including web page content should ALWAYS be done using server side processing.
    Or you use the object element. But that should only be used if no server side processing is possible.

  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 VIPStephan View Post
    Or you use the object element. But that should only be used if no server side processing is possible.
    You do end up with a border around the included content in IE7 though if you include HTML using an object tag. So that isn't practical if you want it to appear to be part of the same page.

    Also if you still need to support IE6 you need two nested object tags and conditional comments. You can get rid of the border in IE6 using CSS from within the included page.
    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
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,927
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    Yes, I assumed that these browsers are of little concern by now.

  5. #20
    Regular Coder
    Join Date
    Jun 2011
    Location
    CA
    Posts
    105
    Thanks
    0
    Thanked 10 Times in 10 Posts
    Quote Originally Posted by felgall View Post
    It doesn't work when JavaScript is turned off!

    Also writing output using innerHTML messes things up of you need JavaScript to be able to interact with those parts of the page - so a lot of the time it will not work with JavaScript turned on.

    Including web page content should ALWAYS be done using server side processing.
    I'm curious: are there any stats on how many people turn off JS, besides web coders who test for this?

  6. #21
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,927
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    There are stats, I’ve heard, which indicate some one figure percentage of users who have no JS. However, statistics are irrelevant because that’s the wrong way of thinking (I know, there are people that would strongly disagree with me). It is my strong conviction that JavaScript should (still, nowadays, in times of “web apps”) be used only as an enhancement of a site that’s already working at least in a basic way; it should not be used as sole solution for crucial functionality. And after all, if a website is coded properly, JavaScript is rarely necessary to provide all the relevant functionality, and if coded properly, rarely any significant additional work is necessary to add the JS enhancements. Plus, it makes future maintenance much easier if functionality is separated and working independently.

    And finally, 1% of a million users is still 10,000 users. Wanna lose 10,000 potential customers/clients because you’re too lazy to do a little more thinking in advance?


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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