diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-03-17 07:45:38 +1100 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-03-17 07:45:38 +1100 |
| commit | 68e873315a0104968a722b7814ad1ce1c62243dd (patch) | |
| tree | 44c7fd9d56c38a288a0a826ff7c33a7f41ec7d2f /js | |
| parent | 50624ba5ce953552c98f3042de4664d6ec0879e3 (diff) | |
Ensure no double-fetching of posts.
Diffstat (limited to 'js')
| -rw-r--r-- | js/post-hover.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/post-hover.js b/js/post-hover.js index 0d0f3bb1..39c4aca6 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -12,6 +12,7 @@ */ $(document).ready(function(){ + var dont_fetch_again = []; $('p.body a:not([rel="nofollow"])').each(function() { var id; @@ -43,6 +44,12 @@ $(document).ready(function(){ start_hover(this); } else { var link = this; + + if($.inArray($(this).attr('href'), dont_fetch_again) != -1) { + return; + } + + dont_fetch_again.push($(this).attr('href')); $.ajax({ url: $(this).attr('href'), context: document.body, |
