AJAX停止加载相同的站点不同的PHP ID

So i have a website that I'm doing for a school project. It's supposed to be like PasteBin. So on the right theres a different div (Uued koodid) that shows newest pastes. On click, they are supposed to show what they include using AJAX to refresh the left div. This only works for 4 times and then stops, but URL is still changing. After refresh it changes again and works again for 4 more times.

In main.js i have

...
$.ajaxSetup({ cache: false });
...
$(".uuedKoodid").click(function () {
    $(".left-content").load(document.location.hash.substr(1));
});
...

EDIT: Also other AJAX functions work. If I log in, I can switch between settings and profile perfectly but still cannot watch new codes

When you replace right menu with new code (from ajax call) you don't attach click event again on .uuedKoodid items so they don't do anything. You need to attach event again or attach it like this:

$(document).on('click', '.uuedKoodid', function () {
  $(".left-content").load(document.location.hash.substr(1));
});

Edit: As you noticed this will cause small problem. onclick event run before browser run standard link action. First you load ajax and then browser changes address. This way you are 1 action behind. Better solution than reading with delay (setTimeout) i think would be to read address directly from link:

$(document).on('click', '.uuedKoodid', function () {
  var url = $(this).attr('href');
  $(".left-content").load(url.substring(url.indexOf("#")+1));
});