Created
May 20, 2015 14:19
-
-
Save fidlerryan/91068e5751c3466f7c25 to your computer and use it in GitHub Desktop.
jQuery example for Accessing the Joomla Framework via an AJAX Call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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