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
 
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,
 
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.
 
Old October 5th, 2009, 09:41 AM
jmcpeak's Avatar
Wrox Author
Points: 467, Level: 7
Points: 467, Level: 7 Points: 467, Level: 7 Points: 467, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2005
Location: , Texas, USA.
Posts: 87
Thanks: 0
Thanked 18 Times in 17 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.
The Following User Says Thank You to jmcpeak For This Useful Post:
wctiger (October 7th, 2009)




Similar Threads
Thread Thread Starter Forum Replies Last Post
zxml.js errors? Richard Frainier BOOK: Professional Ajax ISBN: 978-0-471-77778-6 4 April 13th, 2015 01:57 AM
zxml.js library for firefox 3.0 manahual BOOK: Professional Ajax ISBN: 978-0-471-77778-6 4 March 2nd, 2010 04: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





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