Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Professional Ajax ISBN: 978-0-471-77778-6
| 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 April 6th, 2006, 09:39 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default zxml.js exception in Firefox but works fine in IE

I'm getting the exception below from Firefox, IE works fine. The code is very similar to your sample:

function init() {
  var oReq = zXmlHttp.createRequest();
  oReq.onreadystatechange = function () {
    if (oReq.readyState == 4) {
      // only if "OK"
      if (oReq.status == 200) {
        alert(oReq.responseText);
      }
    }
  };
oReq.open("GET", "http://localhost:8989/mpc10/LocLoader.jsp", true);
oReq.send();
}

The function above is contained in MpcAjaxLocationLoader.htm and gets called onload.

Error: uncaught exception: [Exception... "Not enough arguments [nsIXMLHttpRequest.send]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://localhost:8989/AjaxTest/MpcAj...tionLoader.htm :: init :: line 23" data: no]

  #2 (permalink)  
Old April 6th, 2006, 09:43 AM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

This isn't a zXML error. You must pass a value to send() in Firefox, even if the value is null. So you should be doing:

Code:
oReq.send(null);
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
  #3 (permalink)  
Old April 24th, 2006, 06:35 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In your chapter 4 code, you use:

oReq.send();

instead of what you just suggested:

oReq.send(null);

Even after making that change, the cross browser code does not work in IE or Firefox.

I'll dig deeper to see if I can find the error.

  #4 (permalink)  
Old April 24th, 2006, 07:05 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

If you let me know what error you're getting, I can try to help figure out the problem.

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
  #5 (permalink)  
Old January 1st, 2007, 12:43 PM
Authorized User
 
Join Date: Nov 2003
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to seanmayhew
Default

I had this problem in chapter 2/page 37 and found that if the info.txt doesn't exist the status check just gives a generic undefined message never reaching the "else" alert

  #6 (permalink)  
Old January 1st, 2007, 01:11 PM
Authorized User
 
Join Date: Nov 2003
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to seanmayhew
Default

Actually I found the problem was in checking for the status when onreadystate was not 4(complete)

I found this when trying to run the site from VS.NET and it kept crashing with an msxml3.dll error

  #7 (permalink)  
Old January 29th, 2007, 05:25 AM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What was the solution?



Similar Threads
Thread Thread Starter Forum Replies Last Post
zxml.js library for firefox 3.0 manahual BOOK: Professional Ajax ISBN: 978-0-471-77778-6 4 March 2nd, 2010 04:59 AM
import to simplexml works fine, but cannot output jjk2 Beginning PHP 0 March 22nd, 2008 08:36 PM
Javascript Works Fine in Aspx page but... vivek_inos Javascript 0 June 14th, 2006 01:57 AM
Appletviewer can't find class...but IE works fine dperry BOOK: Beginning Java 2, JDK 5 Edition 0 July 7th, 2005 10:44 AM
Works fine on web server, not on dev machine eoffshore PHP How-To 1 July 9th, 2003 09:32 AM





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