获取每个帖子ID的.ajax结果

On Tumblr, I've got several posts that I'm trying use .ajax to get data from specifically. I'm using an .each to only get data for audio posts. But the problem I'm running into is that it's returning all the posts, not just audio posts. I'm even specifying the json path for each specific post ID. I know I'm probably setting this up completely wrong as I'm not too familar with using .ajax.

$('.audio.post').each(function() {
    var audiopostID = $(this).attr('id');
    var audioPath = '/api/read/json?id=' + audiopostID;

    $.ajax({
        url: audioPath,
        dataType: 'jsonp',
        timeout: 5000,
        success: function(data) {
            console.log(data);
        }
    });
});

As I mentioned, it returns all the posts, not the specific posts I'm trying to get with audioPath. The individual json paths do exist, it just seems the .ajax ignores the individual ones and grabs everything. Here's the first two audio post json paths:

You're pulling the ID field from the following code:

<article class="post text brick" id="post-46308156089" data-postID="46308156089" data-permalink="http://testrtheme.tumblr.com/post/46308156089/test">

The id here is:

post-46308156089

Based on that you're URL looks like:

/api/read/json?id=post-46308156089

Try and change your code to the following:

$('.audio.post').each(function() {
var fullaudiopostID = $(this).attr('id').split('-');
var audiopostID = fullaudiopostID[1];
var audioPath = '/api/read/json?id=' + audiopostID;

$.ajax({
    url: audioPath,
    dataType: 'jsonp',
    timeout: 5000,
    success: function(data) {
        console.log(data);
    }
});
});