OK, this might seem like a dumb question, but please keep in mind that JSON is completely new to me (I've heard the expression before. But know nothing about it).
I have this callback function to notify authors on a site with an email, when new comments are added to the disqus thread.
<script type="text/javascript">
function disqus_config() {
this.callbacks.onNewComment = [function(comment) {
var authname = document.getElementById('authname').value;
var authmail = document.getElementById('authmail').value;
var link = document.getElementById('link').value;
var disqusAPIKey = 'MY_API_KEY';
var disqusCall = 'https://disqus.com/api/3.0/posts/details.json?post=' + comment.id + '&api_key=' + disqusAPIKey;
$.ajax({
type: 'POST',
url: 'URL_OF_MAIL.PHP',
data: {'authname': authname, 'authmail': authmail, 'link': link, 'disqusCall': disqusCall},
cache: false,
});
}];
}
</script>
Everything works like a charm. Except... What is outside the scope of my understanding is (and I've searched around. But seeing as I don't know anything about JSON, I don't even really know what to look for) how to extract the information from 'disqusCall' variable? As it sits now, I just get a link (that contains two things I'm interested in, name and message). I would like to include these in the mail message.
I'm sure this is something simple as "decoding" the JSON information, but I don't know how. And all the posts I've found on this subject have just confused me even more haha