Hi folks, me again - sorry - I am trying to "teach myself" with help here some basic Jquery Ajax so far so good, but .. no offence to people sometimes the answers are very specific to requests - great, but may not be as helpful to others as certainkly a quick google search can get complex. I have got a lot, but it is the simple things that I get stuck on. Try this. A simple .click event and get using JQuery Ajax. to show results of the ajaxed page in a div.
<a href="?abc=1" id="idoflink">Try this link to get results</a>
<div id="testit"></div>
Then Jquery/Ajax
$(document).ready(function(){
$('#idoflink').click(function() {
var idoflinkvaliable = $("#idoflink");
$.ajax({
cache: false, type: "GET", url: "tryit.php", data: "test=" + idoflinkvaliable,
complete: function(data){ $("#testit").html(data.responseText); }
});
return false;
});
});
I know it'is not right - it doesn't work I get [object Object] - so whicj bit is wrong, my guess is in defining the variable?. I know this is only a simple example but as I said I am trying to self teach - know PHP backwards - and a lot of what I find on Google starts beyond this, so your answers may not just help me but hopefully many others to. Thanks in adavance.