User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,231 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,202 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

ajax server-returned message?

Join Date: Jul 2006
Location: Deptford, London
Posts: 916
Reputation: MattEvans will become famous soon enough MattEvans will become famous soon enough 
Rep Power: 5
Solved Threads: 46
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: ajax server-returned message?

  #4  
Nov 27th, 2007
An uncaught exception server side should cause the response to be an 'error 500 internal server error'. I think PHP generates its own descriptive error pages; but it still may respond with a status other than 200.. If you didn't know; every response from a server starts with a 'header' which has important information; a status code, the page's content-type, user-provided data, and a few other things. We don't see that in view-source, and PHP doesn't force you to consider it, but it's there. Use this http://web-sniffer.net/ to view the header of a page that raises an error. See if the HTTP status code is something other than "HTTP/1.1 200 OK". The property ajaxobject.status returns the number of the status code: in this case 200. You can't split up the response from a server into 'errors' or 'non-errors' unless you define how to split it up. There is no such thing as an 'error' in a valid response : it is all basically plain text. The header tells you what the response should be treated as. [ and you can, via PHP, set the response to have any header/status you desire ]
Last edited by MattEvans : Nov 27th, 2007 at 4:34 am.
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
All times are GMT -4. The time now is 4:07 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC