Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Ajax ISBN: 978-0-471-77778-6
This is the forum to discuss the Wrox book Professional Ajax by Nicholas C. Zakas, Jeremy McPeak, Joe Fawcett; ISBN: 9780471777786
Important: For the new 2nd edition of this book, please post here instead: [url="http://p2p.wrox.com/forum.asp?FORUM_ID=307"]http://p2p.wrox.com/forum.asp?FORUM_ID=307[/url]
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Ajax ISBN: 978-0-471-77778-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 9th, 2006, 01:35 AM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default this not working in IE

Hello the below code is working in FF for me, but it IE its not.
[ill explain]

Code:
theReply = http.responseXML;
var layerInfo = theReply.getElementsByTagName("LAYERINFO");
alert(layerInfo.length);
FF is returning the proper length (27 characters) where IE returns 0 as a length

Any help would be great!

Drew

  #2 (permalink)  
Old December 9th, 2006, 06:20 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Firtst of all alert the http.responseText and, in IE, the http.responseXXML.xml, to make sure there actually is a response. Often IE doesn't recognise the content type of the response and so cannot form an XML document.
If this doesn't help let us know where in the book this example is taken from.

--

Joe (Microsoft MVP - XML)
  #3 (permalink)  
Old December 9th, 2006, 08:05 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Well from my readings it seems to be a Content-Type issue
The example i showed you above is not in the book. Its me just playing around and getting to know ajax more.

If I alert(http.responseXML.xml) in IE, i get nothing.
If I alert(http.responseText) in IE i do my get result.

How can it tell IE that the information coming in is in XML so it will work?
I do not have control of the XML coming in, it comes from a program I do not have access too.
Drew

  #4 (permalink)  
Old December 9th, 2006, 09:54 PM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Drew - you should set the content type of the response on the server-side.

For future reference, this forum is for supporting the book. General JavaScript/Ajax questions should be posted in the General JavaScript forum.

Thanks.

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
  #5 (permalink)  
Old December 9th, 2006, 10:01 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the tip.
I am unable to set the content type on the server side because it comes from an external program i do not have control over.
I might look into converting it into an XML document somehow...

Ya. I googled "Ajax Forum" and this was in the top 3 results. I never really looked to see it was related to a book. :)

All good though. Gave me exposure to the site and maybe ill look into purchasing the book :)

Drew


  #6 (permalink)  
Old December 10th, 2006, 06:54 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Well in that case you need to hack it. If using IE load the responseText into a DomDocument and proceed from there.
You can also look at getAllResponseHeaders() to see what the actual content type is, it maybe one that IE doesn't recognise.

--

Joe (Microsoft MVP - XML)


Similar Threads
Thread Thread Starter Forum Replies Last Post
window.opener working .... not working alyeng2000 Javascript How-To 5 January 5th, 2007 08:05 AM
Web.Config..Working or Not Working peace95 ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 06:53 AM
Local COM working , but not working at Web Serv nagen111 .NET Web Services 3 February 19th, 2005 04:22 AM
Example not working CKucler BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 December 8th, 2004 11:26 AM
Get Working Copy... not working Enkiel Classic ASP Basics 0 April 21st, 2004 01:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.