Hi, can i use Ajax in Joomla ?😑
If yes please someone give me a document explain how i can use it & thank you 🙂
If yes please someone give me a document explain how i can use it & thank you 🙂
function maFonctionAjax(Id)
{
var OAjax;
if (window.XMLHttpRequest) OAjax = new XMLHttpRequest();
else if (window.ActiveXObject) OAjax = new ActiveXObject('Microsoft.XMLHTTP');
OAjax.open('POST',"index.php?option=com_chronoforms&chronoform=ajax2",true);
OAjax.onreadystatechange = function()
{
if (OAjax.readyState == 4 && OAjax.status==200)
{
document.getElementById('msg').innerHTML=OAjax.responseText;
}
}
OAjax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
OAjax.send('Id='+Id);
}
<html><head>
<title>Areatext</title>
<body>
<form method="post" onsubmit="maFonctionAjax(this.Id.value);return false" action="">
<table border="0" cellspacing="0">
<tr>
<td colspan=2>
Formulaire Ajax
</td>
</tr>
<tr>
<td>Id:</td>
<td>
<input name="Id" id="Id" type="text"></td>
</tr>
</table>
<input type="submit" value="ok"></td>
</form>
<div id="msg">
</div>
</body>
</html>
<?php
$id=$_POST['Id'];
echo $id;
?>
index.php?option=com_chronoforms&chronoform=ajax2