Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inputting Images from an XML page using javascript please Help!!

Status
Not open for further replies.

elloco07

Programmer
Sep 15, 2001
1
US
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 (&quot;microsoft.xmldom&quot;);

xm1Doc1.load(&quot;index.xml&quot;);

function StartUp()

{

if(xm1Doc1.readyState==&quot;4&quot;)

{

StartLoading();

}

else

{

alert(&quot;loading operation could not start&quot;);

}

}

function StartLoading()

{

RootElement1=xm1Doc1.documentElement; img1data.innerText=RootElement1.childNodes.item(0).text;

}

</script>

</head>

<body bgcolor=&quot;#FFFFFF&quot; onLoad=&quot;StartUp()&quot;>

!-- image output here --

<span id=img1data></span>

</body>


Here is my XML Page

<?xml version=&quot;1.0&quot; ?>
<IMAGES>
<IMG1>&amp;lt;img src=&quot;images/sample.svg&quot;&gt;</IMG1>
<IMG2>&amp;lt;img src=&quot;images/Ani_tesa.gif&quot;&gt;</IMG2>
<IMG3>&amp;lt;img src=&quot;images/Hotel_i2.gif&quot;&gt;</IMG3>
<IMG4>&amp;lt;img src=&quot;images/I_ani.gif&quot;&gt;</IMG4>
<IMG5>&amp;lt;img src=&quot;images/I_fondo.gif&quot;&gt;</IMG5>
<IMG6>&amp;lt;img src=&quot;images/I_m1.gif&quot;&gt;</IMG6>
<IMG7>&amp;lt;img src=&quot;images/I_m21.gif&quot;&gt;</IMG7>
<IMG8>&amp;lt;img src=&quot;images/I_m22.gif&quot;&gt;</IMG8>
<IMG9>&amp;lt;img src=&quot;images/I_m23.gif&quot;&gt;</IMG9>
<IMG10>&amp;lt;img src=&quot;images/I_m24.gif&quot;&gt;</IMG10>
<IMG11>&amp;lt;img src=&quot;images/I_m25.gif&quot;&gt;</IMG11>
<IMG12>&amp;lt;img src=&quot;images/I_m26.gif&quot;&gt;</IMG12>
<IMG13>&amp;lt;img src=&quot;images/I_m27.gif&quot;&gt;</IMG13>
<IMG14>&amp;lt;img src=&quot;images/I_m31.gif&quot;&gt;</IMG14>
<IMG15>&amp;lt;img src=&quot;images/I_m33.gif&quot;&gt;</IMG15>
<IMG16>&amp;lt;img src=&quot;images/I_m4.gif&quot;&gt;</IMG16>
</IMAGES>


Can some help me and let me know if this is possible thanks alot


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top