SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question XMLHttp & its reach?

    hi
    I'm working on a kind of chat project in which I need to see if the user is online or not.
    I plan on using XMLHttp. I've never used it before, not with JavaScript, only with ASP. So I don't know the ins & outs or any of the other stuff. I would like to know how far is XMLHttp with JavaScript supported in Browsers? Which browser don't support it? Please don't give me answers like "IE3 doesn't support it", or any stuff like that.

    What I plan to do is using XMLHttp, I'll call a page at regular intervals using setInterval which will check if the user session is valid or not. According to the value returned, the user will be redirected to the login page if his session has been expired.

    So tell me is there anything wrong with my idea of approach? What possible reasons can you give me for not using XMLHttp?
    Please do not provide reasons like "It'll not work if Javascript is disabled", etc. The users are allowed access only if JavaScript is enabled, so its almost 100% definite that JavaScript will be enabled.

    But firstly, I'd like to know the browsers that don't support XMLHttp in JavaScript, as that'll be the key factor in deciding whether to use it or not. I expect the user base will be IE5+ & Netscape6+.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  2. #2
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you should take a look at this project : http://jpspan.sourceforge.net/wiki/doku.php

    it's a php to js bridge, but the clientside (js) libraries should be easy to pluck out and use against asp. theres a lot of secondary info and links too.

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Nothing wrong with XMLHttp really, as long as you're detecting support for it correctly. Instead of user agent detection, do this:
    Code:
    if (window.ActiveXObject)
    {
      //IE code fork
    }
    else if (window.xmlHttpRequest)
    {
      //Gecko/Safari code fork
    }
    I think xmlHttp works in Opera as well now, but only in the most recent versions (7.6).

  4. #4
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Cool

    I'm not targetting Opera users, so that won't be much of an issue, I just want the application to work in IE4+, Netscape6+ & Mozilla. If that works, then its fine for me.
    Also, I plan to use one of the wrappers mentioned in Simon's Blog Post at http://www.sitepoint.com/blog-post-view.php?id=185942.
    I guess the ones labelled as cross browser must be having the support detection & code forks accordingly.
    I dunno, I'll follow the links & read up on it. Its alien world for me.

    kyberfabrikken, thanks for the link. I'll look it up. BTW, I'm working with PHP in this project & not ASP. I just mentioned it to highlight that I've worked with XMLHttp only in ASP. But since my workfield is pretty stretched, I work in PHP & ASP simultaneously, so it'll be nice to have it working with ASP. I'll look into it & if the license & my skill permit, I'll port the JS Libraries to work with ASP.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!

  5. #5
    SitePoint Addict Guimauve's Avatar
    Join Date
    Aug 2004
    Location
    Chicago
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good timing, I was working with newXmlHTTP yesterday. Take a look here for info:

    http://www.sitepoint.com/forums/show...37&postcount=8
    and
    http://jibbering.com/2002/4/httprequest.html

    Charles

  6. #6
    SitePoint Wizard silver trophybronze trophy asp_funda's Avatar
    Join Date
    Jun 2003
    Location
    ether
    Posts
    4,497
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That's good article Charles. Thanks.
    Our lives teach us who we are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Me - Photo Blog - Personal Blog - Dev Blog
    iG:Syntax Hiliter -- Colourize your code in WordPress!!


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
  •