Guys, just a quick question, is there any way to get this AJAX to be called on a button click? I know how to use buttons to call JS functions but I'm not sure where to add the open and closing parentheses with this AJAX...I've tried encasing different parts, but to no avail.
So guessing I have to do something different here? I'm not sure, really new to this.
And yes I've tried searching, again it's very specific and a bit vague.
$(document).ready(function(){
$('#xavisys-logo').live('click', function(e) {
var r1='';
var r2='';
e.preventDefault();
$.get("char_con.php?", {act: 'char_con'}, function(data){
r1=data;
});
$.getJSON("generator.php?", {act: 'char_con', bc: '1'}, function(data){
r2=data;
$(".quote").html( r1 + r2 );
});
});
});
Anyone mind helping me out and showing how this would be done?
Any help appreciated.