astralaaron Posted February 11, 2008 Share Posted February 11, 2008 Hello, I am working toward learning about AJAX, and w3schools recommends to learn javascript xml html and cssi am comfortable with css and html.I want to start learning about XML, so.. if anyone can shed some light on what XML is about, why use it? and what kinds of things it can do that would be great Link to comment Share on other sites More sharing options...
jhecht Posted February 11, 2008 Share Posted February 11, 2008 this is a Very well kept secretbut you don't actually need to know XML for Ajax... Never used XML with an AJAX app yet ;p Link to comment Share on other sites More sharing options...
Synook Posted February 11, 2008 Share Posted February 11, 2008 ... http://www.w3schools.com/xml/default.aspBut yes, naming it XMLHttpRequest is a bit of a misnomer as it really just loads the document as text.Though for XML developers of course the responseXML property can come in very handy. Link to comment Share on other sites More sharing options...
boen_robot Posted February 11, 2008 Share Posted February 11, 2008 Receiving XML instead of text allows you to have structured data i.e. instead of receiving one big pile of text to process with regular expressions, you can have a few pieces of data which you can jump between with ease. The same applies to JSON, but JSON is parsed into JavaScript object(s), instead of nodes, which may feel less intuitive to you if you like HTML more than JavaScript. Link to comment Share on other sites More sharing options...
astralaaron Posted February 16, 2008 Author Share Posted February 16, 2008 will somebody help me understand nodes? its just like a variable?how do you switch through the nodes like you are talking about 'with ease'? Link to comment Share on other sites More sharing options...
jhecht Posted February 16, 2008 Share Posted February 16, 2008 nodes are XML things that list where they are in the XML document. Thats about the best way i can describe it to you. I'll try to explain it with a bit more example //assume all of that fun encoding stuff is on the top of this page<notes> <note to="Bob" from="Joey"> <message> Hey bob, tomorrow we should go clubbin'! 1337 sauce. </message> </note> <note to="Joey" from="Bob"> <message> Sure, let's go clubbin'! ROFLCopter! </message> </note></notes> The top post parent Node is the tag "notes". "note" tags are child nodes to "notes", i.e., they are the next sublevel down in the XML tree.The first note node is a sibling node to the second note node. the parent node for the message tag, however, would be the corresponding <note> tag which the message tag is in.(calling parentNode from the second message tag would not be the same as calling parentNode from the first basically).I know its probably not a very good definition, but its the best i can give you. Link to comment Share on other sites More sharing options...
astralaaron Posted February 16, 2008 Author Share Posted February 16, 2008 nodes are XML things that list where they are in the XML document. Thats about the best way i can describe it to you. I'll try to explain it with a bit more example//assume all of that fun encoding stuff is on the top of this page<notes> <note to="Bob" from="Joey"> <message> Hey bob, tomorrow we should go clubbin'! 1337 sauce. </message> </note> <note to="Joey" from="Bob"> <message> Sure, let's go clubbin'! ROFLCopter! </message> </note></notes> The top post parent Node is the tag "notes". "note" tags are child nodes to "notes", i.e., they are the next sublevel down in the XML tree.The first note node is a sibling node to the second note node. the parent node for the message tag, however, would be the corresponding <note> tag which the message tag is in.(calling parentNode from the second message tag would not be the same as calling parentNode from the first basically).I know its probably not a very good definition, but its the best i can give you. document.getElementById("notes").innerHTML=xmlDoc.getElementsByTagName("note")[0].childNodes[0].nodeValue;document.getElementById("notes").innerHTML=xmlDoc.getElementsByTagName("note")[1].childNodes[0].nodeValue;so i would get both of those messages by doing this??? Link to comment Share on other sites More sharing options...
astralaaron Posted February 16, 2008 Author Share Posted February 16, 2008 this is a Very well kept secretbut you don't actually need to know XML for Ajax... Never used XML with an AJAX app yet ;plol, what do you need to know to start learning AJAX? please let me know Link to comment Share on other sites More sharing options...
Synook Posted February 16, 2008 Share Posted February 16, 2008 You need to know HTML and JavaScript. Knowledge of a server-side language will also help. Link to comment Share on other sites More sharing options...
astralaaron Posted February 16, 2008 Author Share Posted February 16, 2008 You need to know HTML and JavaScript. Knowledge of a server-side language will also help.been messing with html for years, can work with css.. and have learned a lot about php.now starting to learn javascript and xml Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.