Jump to content

Trouble with AJAX XML Example tutorial


Guest Ian Shaw

Recommended Posts

Guest Ian Shaw

I'm having trouble understanding the AJAX XML Example tutorial - and how XML data is assigned to HTML tags.I've successfully got the tutorial working on my own server, but I'm having trouble extending it - which shows I don't really understand what is going on.I've tried to use the returned data a couple of different ways - in a script and passing it to another span - but I can't get my extra code to update. Please could someone explain what is going on. Is it something to do with the timing of when the head and body are processed?Thanks in advance.

<html><head><script src="selectcd.js"></script></head><body><form> Select a CD:<select name="cds" onchange="showCD(this.value)"><option value="Bob Dylan">Bob Dylan</option><option value="Bonnie Tyler">Bonnie Tyler</option><option value="Dolly Parton">Dolly Parton</option> </select></form><p><div id="txtHint" onchange="txtHint2.innerHTML = this.innerHTML)"><b>CD info will be listed here.</b></div></p><p><b>Repeat the data with a script: </b><script>document.write(txtHint.innerHTML, " It is",txtHint.innerHTML.length," characters long.")</script><br>Repeat the data with a span: <span id="txtHint2"></span></div></p></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...