Skip to content

Instantly share code, notes, and snippets.

@fidlerryan
Created May 20, 2015 14:19
Show Gist options
  • Save fidlerryan/91068e5751c3466f7c25 to your computer and use it in GitHub Desktop.
Save fidlerryan/91068e5751c3466f7c25 to your computer and use it in GitHub Desktop.
jQuery example for Accessing the Joomla Framework via an AJAX Call
$.ajax({
type: 'POST',
url: '/path/to/PHP/file',
dataType: 'json',
data: { catid: $("#catid").val() },
success: function(data){
$('.item-page').prepend(
$('<h2>').append(
$('<span>')
.addClass('subheading-category')
.text(data.msg)
)
)
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
console.log('There was an error.');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment