jfquestiaux
Well-Known Member
I am trying my first attempt to get an Ajax call working but I am stuck at the moment, partly because of confusing informations : there is one code in the comments of the ajax_user_example.php file and another in the Fabrik tutorial #7.
The later being older, I started with the first one, but both gives me an error (not the same though).
This is my first attempt :
This gives me the error :
Erreur : (new Request({url: url, onComplete: function (response) {if (response != "") {alert(response);}}})).request is not a function
So I tried this :
This time I get :
Erreur : Ajax is not defined
Can some JS guru help me out? It would be greatly appreciated.
The later being older, I started with the first one, but both gives me an error (not the same though).
This is my first attempt :
Code:
<script type="text/javascript">
function useIdVenue(idVenue)
{
document.getElementById("bottomRightColumn").style.display = "none";
document.getElementById("middleRightColumn").style.display = "block";
var url = "index.php?option=com_fabrik&format=raw&task=plugin.userAjax&method=displayVenueData&row_id=" + idVenue;
new Request({url:url, onComplete: function(response) {
if (response != '') {
alert(response);
}
}
}).request();
}
</script>
Erreur : (new Request({url: url, onComplete: function (response) {if (response != "") {alert(response);}}})).request is not a function
So I tried this :
Code:
<script type="text/javascript">
function useIdVenue(idVenue)
{
document.getElementById("bottomRightColumn").style.display = "none";
document.getElementById("middleRightColumn").style.display = "block";
var url = "index.php?option=com_fabrik&format=raw&task=plugin.userAjax&method=displayVenueData&row_id=" + idVenue;
var update = $('middleRightColumn');
new Ajax(url, {data:{
method:'displayVenueData','row_id':idVenue},
onComplete:function(r) {
update.setHTML(r);
}
}).request();
}
</script>
Erreur : Ajax is not defined
Can some JS guru help me out? It would be greatly appreciated.