SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    FBI secret agent digitman's Avatar
    Join Date
    Sep 2004
    Location
    Work
    Posts
    697
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking Making seperate pages for users with javascript disabled?

    Hi.
    I'm building a very AJAX+Javascript heavy site. The problem is, i'll be doing things like, displaying a sign up form,validating the login, etc through javascript and ajax. For example, if you click a 'Sign up' link, a sign up form will pop up on the same page through javascript.

    I was thinking that, if someone doesn't have javascript enabled, if he clicks the 'Sign up' link, he should be taken to a seperate page which displays the sign up form.
    But then I realized that if I build a seperate page for everything, I'll have to do twice as much work building and maintaining everything.
    So what should I do? I expect most of the people using my site will have javascript enabled, but still....

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,454
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)

    ajax

    If you're just making the site you're lucky. It should be easier to develop it right to begin with than it would be to "fix" it later.
    Quote Originally Posted by digitman
    a very AJAX+Javascript heavy site.
    The trick is to only use javascript to enhance a user's experience, not rely upon it. If you code in HTTP requests for both new page loads and AJAX transfer, it doesn't mean you'll need to have static copies of all the pages does it? It seems that by using GET vars you could go to the same page but with the new content based on the variable similar to using AJAX to pull new content without the page reload. If you have javascript relplace the "hard" links with the AJAX stuff that would only be one page, not 2 versions of it. True pop-ups would be out, but that wouldn't be for every page. It might be a bit more work one way or the other I suppose (AJAX vs. redundant pages), but neither should be impossible, just more work.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Code the page so that it works without Javascript first. Once that is working properly then you add the Javascript/Ajax code that avoids the page reloads. That way it works for those without Javascript and works better for thos with Javascript.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Addict
    Join Date
    Aug 2005
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by digitman
    Hi.
    I'm building a very AJAX+Javascript heavy site.
    . . .

    But then I realized that if I build a seperate page for everything, I'll have to do twice as much work building and maintaining everything.
    TWICE as much?? You'll be LUCKY if it's only twice as much!

    Keep in mind that it's FAR more efficient to generate something programmatically than by hand. And it's also easier to modify it programmatically.

    Currently I'm designing a new photo gallery website for myself. I've got 8 pages of thumbnail galleries and each gallery has 32 images. That's 256 images, total. I want to display each fullsize in a window framed to fit the image, with background color suitable to the image, and a caption or other information about the photo.

    I can generate all this with a couple of relatively simple javascript functions - when the user clicks the thumbnail it calls the window-create function with a few simple parameters. If I had to hand-create 256 separate HTML files, one for each image it would be a P.I.T.A, and if I wanted to change something I would have to change it in 256 places! With Javascript I can change it in just ONE place : the function that creates the window.

    You will also discover plenty of things that simply canot be done in HTML alone.

    I agree that there is a certain % of the web-browsing public that won't be able to access your site. Most of the numbers I've seen are < 10%. A FAR bigger problem is the insane inconsistency with which Javascript is implemented in different browsers, or even different VERSIONS of the SAME browser, either through bugs or sheer-bloody-mindedness by the browser writers, many features are either totally unsupported, or differently-supported by different browsers.


Bookmarks

Posting Permissions

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