SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru OfficeOfTheLaw's Avatar
    Join Date
    Apr 2004
    Location
    Quincy
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript fallback

    I'm a big advocate of only using javascript to provide enhanced functionality, but still having all the functionality work without javascript. Anyway, I'm currently working ona web application that I've been considering using xmlHttpRequest to make the UI more rich, and in addition to being prepared for people with javascript disabled, how can I also keep people with outdated browsers from getting javascript errors?

    I'm basically thinking that nothing other than browser sniffing, which I hate.

    James Carr, Software Engineer


    assertEquals(newXPJob, you.ask(officeOfTheLaw));

  2. #2
    SitePoint Evangelist SpaceFrog's Avatar
    Join Date
    Jan 2005
    Location
    Outerspace
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    spotting all deprecated instructions per version and doing try catch with them ?

  3. #3
    SitePoint Guru
    Join Date
    Jun 2004
    Location
    Finland
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    if (window.XMLHttpRequest) {
      var xmlhttp = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
      var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
    }
    else {
      alert("You're screwed.");
    }

  4. #4
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    window.onerror = function() { return true };
    
    // do what you want

  5. #5
    SitePoint Guru OfficeOfTheLaw's Avatar
    Join Date
    Apr 2004
    Location
    Quincy
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stereofrog
    Code:
    window.onerror = function() { return true };
    
    // do what you want
    Thanks... that was EXACTLY what I wanted, as most links actually point to a serverside page that performs the action, with an onclick attribute that returns false on successful execution of a function (i.e. retrieve message data from xmlhttp and set appropriate inputs).

    James Carr, Software Engineer


    assertEquals(newXPJob, you.ask(officeOfTheLaw));


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
  •