|
|
 |
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

May 5th, 2009, 03:34 PM
|
|
Registered User
|
|
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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,
|

October 4th, 2009, 06:10 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
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.
|

October 5th, 2009, 10:41 AM
|
 |
Wrox Author
|
|
Join Date: Nov 2005
Location: , Texas, USA.
Posts: 33
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
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:
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |