Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as HTML by tester ( 16 years ago )
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
[removed]
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","cd_catalog.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
x=xmlDoc.getElementsByTagName("CD");
function displayCDInfo(i)
{
artist =(x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);
title =(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
year =(x[i].getElementsByTagName("YEAR")[0].childNodes[0].nodeValue);
country =(x[i].getElementsByTagName("COUNTRY")[0].childNodes[0].nodeValue);
company =(x[i].getElementsByTagName("COMPANY")[0].childNodes[0].nodeValue);
price =(x[i].getElementsByTagName("PRICE")[0].childNodes[0].nodeValue);
txt ="Artist: "+artist+"<br />Title: "+title+"<br />Year: "+year+"<br />Country: "+country+"<br />Company: "+company+"<br />Price: "+price ;
document.getElementById("showCD")[removed]=txt;
}
function displayArtInfo(i)
{
showart =(x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);
arttxt ="ARTIST: "+showart+"<br />";
document.getElementById("showART")[removed]=arttxt;
}
function displayAlbomInfo(i)
{
title =(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
albtxt ="ALBOM: "+title+"<br />";
document.getElementById("showALB")[removed]=albtxt;
}
function addToXML()
{
var add = document.createElement('val1');
}
[removed]
</head>
<body>
<div>форма добавления данных</div><br />
[removed]
[removed]("<table border='1'>");
[removed]("<form>");
[removed]("<input id='val1' type='text' maxlength='25' size='25'>");
[removed]("<input id='val2' type='text' maxlength='25' size='25'>");
[removed]("<input type='submit' value='save'>");
[removed]("</form>");
[removed]("</table>");
[removed]<br />
<div id='showCD'>Click on a CD to display album information.</div><br />
[removed]
[removed]("<table border='1'>");
for (var i=0;i<x.length;i++)
{
[removed]("<tr>");
[removed]("<td>");
[removed](x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);
[removed]("</td><td>");
[removed](x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
[removed]("</td></tr>");
}
[removed]("</table>");
[removed]
<div id='showART'> show ART </div><br />
[removed]
[removed]("<table border='1'>");
for (var i=0; i <x.length; i++)
{
[removed]("<tr>");
[removed]("<td>");
[removed](x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);
[removed]("</td></tr>");
}
[removed]("</table>");
[removed]
<div id='showALB'> show ALBOM </div><br />
[removed]
[removed]("<table border='1'>");
for (var i=0; i < x.length; i++)
{
[removed]("<tr>");
[removed]("<td>");
[removed](x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
[removed]("</td></tr>");
}
[removed]("<table>");
[removed]
</body>
</html>
Revise this Paste