SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: XMLHttp & its reach?
-
Nov 10, 2004, 06:51 #1
- Join Date
- Jun 2003
- Location
- ether
- Posts
- 4,497
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
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!!
-
Nov 10, 2004, 08:27 #2
- 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.
-
Nov 10, 2004, 08:33 #3
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 }
-
Nov 11, 2004, 01:52 #4
- Join Date
- Jun 2003
- Location
- ether
- Posts
- 4,497
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
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!!
-
Nov 11, 2004, 08:14 #5
- 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
-
Nov 12, 2004, 05:37 #6
- 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