Hello guys i'm new with programming and i've been wondering if i could use AJAX with this: i have 4 words with links and when i press them i want to show some images and a text. Is this posible ?
Here is the code that i use (i only know how to show different texts):
<script type="text/javascript">
function loadXMLDoc(url)
{
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",url,false);
xmlhttp.send(null);
document.getElementById('text').innerHTML=xmlhttp.responseText;
}
</script>
<div class="sublink"><a href="proiect.html" onClick="loadXMLDoc('proiect/concept.txt');return false;">Concept</a> <a href="proiect.html" onClick="loadXMLDoc('proiect/vile.txt');return false;">Vile</a> <a href="proiect.html" onClick="loadXMLDoc('proiect/apartamente.txt');return false;">Apartamente</a> <a href="proiect.html" onClick="loadXMLDoc('proiect/facilitati.txt');return false;">Facilitati</a><br>
<br>
</div>