Hello all I am trying to write a javascript that will display an Image from an XML page. when I open the page all it displays is the path like this img src="images/ani_pressroom.gif" instead of the actual Image itself
Here is the code
<head>
<script language=JavaScript>
var RootElement1;
var xm1Doc1=new ActiveXObject ("microsoft.xmldom"
xm1Doc1.load("index.xml"
function StartUp()
{
if(xm1Doc1.readyState=="4"
{
StartLoading();
}
else
{
alert("loading operation could not start"
}
}
function StartLoading()
{
RootElement1=xm1Doc1.documentElement; img1data.innerText=RootElement1.childNodes.item(0).text;
}
</script>
</head>
<body bgcolor="#FFFFFF" onLoad="StartUp()">
!-- image output here --
<span id=img1data></span>
</body>
Here is my XML Page
<?xml version="1.0" ?>
<IMAGES>
<IMG1>&lt;img src="images/sample.svg"></IMG1>
<IMG2>&lt;img src="images/Ani_tesa.gif"></IMG2>
<IMG3>&lt;img src="images/Hotel_i2.gif"></IMG3>
<IMG4>&lt;img src="images/I_ani.gif"></IMG4>
<IMG5>&lt;img src="images/I_fondo.gif"></IMG5>
<IMG6>&lt;img src="images/I_m1.gif"></IMG6>
<IMG7>&lt;img src="images/I_m21.gif"></IMG7>
<IMG8>&lt;img src="images/I_m22.gif"></IMG8>
<IMG9>&lt;img src="images/I_m23.gif"></IMG9>
<IMG10>&lt;img src="images/I_m24.gif"></IMG10>
<IMG11>&lt;img src="images/I_m25.gif"></IMG11>
<IMG12>&lt;img src="images/I_m26.gif"></IMG12>
<IMG13>&lt;img src="images/I_m27.gif"></IMG13>
<IMG14>&lt;img src="images/I_m31.gif"></IMG14>
<IMG15>&lt;img src="images/I_m33.gif"></IMG15>
<IMG16>&lt;img src="images/I_m4.gif"></IMG16>
</IMAGES>
Can some help me and let me know if this is possible thanks alot
Here is the code
<head>
<script language=JavaScript>
var RootElement1;
var xm1Doc1=new ActiveXObject ("microsoft.xmldom"
xm1Doc1.load("index.xml"
function StartUp()
{
if(xm1Doc1.readyState=="4"
{
StartLoading();
}
else
{
alert("loading operation could not start"
}
}
function StartLoading()
{
RootElement1=xm1Doc1.documentElement; img1data.innerText=RootElement1.childNodes.item(0).text;
}
</script>
</head>
<body bgcolor="#FFFFFF" onLoad="StartUp()">
!-- image output here --
<span id=img1data></span>
</body>
Here is my XML Page
<?xml version="1.0" ?>
<IMAGES>
<IMG1>&lt;img src="images/sample.svg"></IMG1>
<IMG2>&lt;img src="images/Ani_tesa.gif"></IMG2>
<IMG3>&lt;img src="images/Hotel_i2.gif"></IMG3>
<IMG4>&lt;img src="images/I_ani.gif"></IMG4>
<IMG5>&lt;img src="images/I_fondo.gif"></IMG5>
<IMG6>&lt;img src="images/I_m1.gif"></IMG6>
<IMG7>&lt;img src="images/I_m21.gif"></IMG7>
<IMG8>&lt;img src="images/I_m22.gif"></IMG8>
<IMG9>&lt;img src="images/I_m23.gif"></IMG9>
<IMG10>&lt;img src="images/I_m24.gif"></IMG10>
<IMG11>&lt;img src="images/I_m25.gif"></IMG11>
<IMG12>&lt;img src="images/I_m26.gif"></IMG12>
<IMG13>&lt;img src="images/I_m27.gif"></IMG13>
<IMG14>&lt;img src="images/I_m31.gif"></IMG14>
<IMG15>&lt;img src="images/I_m33.gif"></IMG15>
<IMG16>&lt;img src="images/I_m4.gif"></IMG16>
</IMAGES>
Can some help me and let me know if this is possible thanks alot