Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 11-01-2010, 06:09 PM   #1
Join Date: Feb 2009
Posts: 129
Question Cross-browser xml reading.

Hello, I've googled the hell out of this and searched these forums, but can't find a tutorial in laymens terms for me to understand, also, they are all nearly completely different.

I want to be able to get the xml from here: http://feeds.bbci.co.uk/news/world/rss.xml

I have been using Flash (AS2) for the past 4 years and have a high intermediate knowledge of it, I know how to read XML in flash, but I want to learn how to do it with Javascript and HTML5 as I do think this is the way forward - not looking for a debate about this btw :P

Can anyone provide a simple tutorial on how to do this?


p.s I have a simple knowledge of JS such as simple if statements, other simple statements and changing CSS properties.

Last edited by Adam_C; 11-01-2010 at 06:30 PM..
Adam_C is offline   Reply With Quote
Old 11-07-2010, 05:41 AM   #2
Join Date: Dec 2004
Posts: 405

First things first, if you are good at AS then you already should be good at javascript because both AS & js are dialects of ECMAScript.

So assuming your knowledge of AS, the question is how do you read XML with AS? You use an XML parser (built in flash).

Similarly you need an XML parser for javascript. There are several js frameworks that do that, you can pack and choose the one you are most confy with.

Just listing the broad steps below:

1. Your HTML document is ready (in other word your DOM tree is complete)
2. Once ready you use ajax to request the XML document (your chosen framework should let you do that)
3. once the ajax call returns the XML you pass it on to your framework's parser and the parser should give you an object.
4. Use this object to populate your html

The frameworks you could look at are jquery, YUI, mootools, etc.
ranjan is offline   Reply With Quote

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 On
HTML code is Off

Forum Jump

All times are GMT. The time now is 10:38 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com