Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 5th, 2009, 02:34 PM
Registered User
 
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default zXml.js for Chrome

Hi,

Testing example from chapter 4 in Google Chrome, I get this error:

uncaught exception TypeError: Property '__load__' of object #<a Document> is not a function


Are there any plans to release a zXml.js lib that is also compatible with Google Chrome?

Thank you,
Reply With Quote
  #2 (permalink)  
Old October 4th, 2009, 05:10 AM
Registered User
 
Join Date: Oct 2009
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi,

I've met similar problems when testing XML cross-browser example from chapter4 in Google Chrome too. My code run well in IE8 & Firefox, but in Chrome there's nothing but blank.
Moreover, even using the example code downloaded from the web, there's still nothing displayed in Chrome.

I'm hoping for a new release of zXml.js which can support Google Chrome better.

Thanks.
Reply With Quote
  #3 (permalink)  
Old October 5th, 2009, 09:41 AM
jmcpeak's Avatar
Wrox Author
Points: 361, Level: 6
Points: 361, Level: 6 Points: 361, Level: 6 Points: 361, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2005
Location: , Texas, USA.
Posts: 77
Thanks: 0
Thanked 12 Times in 12 Posts
Default

Howdy, folks!

I'll check in with Nicholas and see if he's still supporting the zXml library. If not, I'll update it a bit as time allows in the next few days. In the meantime, you can use an XMLHttpRequest object to grab the XML file and parse it with loadXML(), like this:
Code:
function init() {
    var oXmlDom = zXmlDom.createDocument();
    var oReq = zXmlHttp.createRequest();

    oReq.onreadystatechange = function() {
        if (oReq.readyState == 4) {
            oXmlDom.loadXML(oReq.responseText);
            parseBookInfo(oXmlDom);
        }
    };

    oReq.open("GET", "books.xml", true);
    oReq.send(null);
    
//    var oXmlDom = zXmlDom.createDocument();
//    oXmlDom.onreadystatechange = function () {
//        if (oXmlDom.readyState == 4) {
//            if (oXmlDom.parseError.errorCode == 0) {
//                parseBookInfo(oXmlDom);
//            } else {
//                var str = "An error occurred!!\n" +
//                    "Description: " + oXmlDom.parseError.reason + "\n" +
//                    "File: " + oXmlDom.parseError.url + "\n" +
//                    "Line: " + oXmlDom.parseError.line + "\n" +
//                    "Line Position: " + oXmlDom.parseError.linepos + "\n" +
//                    "Source Code: " + oXmlDom.parseError.srcText;

//                alert(str);
//            }
//        }
//    };
//    oXmlDom.load("books.xml");
}
It isn't perfect by any stretch of the imagination, but it works. Note that since this code uses XMLHttpRequest, the page has to be served from a web server or it will not work.
Reply With Quote
The Following User Says Thank You to jmcpeak For This Useful Post:
wctiger (October 7th, 2009)
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
zxml.js errors? Richard Frainier BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 February 20th, 2012 06:44 AM
zxml.js library for firefox 3.0 manahual BOOK: Professional Ajax ISBN: 978-0-471-77778-6 4 March 2nd, 2010 03:59 AM
zxml.js - is there a readable copy available? bobwazz BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 May 17th, 2007 09:21 AM
syntax error only when zxml.js included daddy BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 July 1st, 2006 10:33 PM
MSXML 6 in zxml.js rloewy BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 May 2nd, 2006 02:23 AM



All times are GMT -4. The time now is 04:22 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.