It sounds like you're running into browser cross-origin restrictions. Javascript running on one site isn't allowed to make AJAX requests to other third-party sites. Browsers restrict these requests for security reasons. Imagine if I hid $.get("http://danbooru.donmai.us/dmails.json")
on a site I owned and tricked you into visiting my site. I'd be able to read your dmails if that were allowed.
Sites can allow cross-origin requests by sending a Access-Control-Allow-Origin: *
header. Currently only /posts.json is whitelisted in this way, which is why that works but other endpoints don't. Other endpoints could be whitelisted but there are security issues to keep in mind. I'll make an issue for it.
In the meantime, if you happen to be doing this within a userscript you can bypass cross-origin restrictions by using GM_xmlHttpRequest. See here for how to patch jQuery to work with GM_xmlHttpRequest. Otherwise, you'll have to run your script outside a browser environment.
PS: if you just want to scrape tag counts then look at http://danbooru.donmai.us/cache/tags.json.gz. It's a full dump of the tags table updated nightly.