embedTumblrPosts calls which avoid browser cache issues!

solved this call to avoid browser cache issues, using a versioning technique! This fiddle will use promises

by Chris Vitalos

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<!DOCTYPE html>
<html lang="en-US">

  <head>
    <script>
      // -- DEBUG flag
      var DEBUG = 0;

      function embedTumblrPosts(loc, limit, tag2include, tag2ignore) {
        if (typeof(tumblr_api_read) === undefined) {
          console.log("tumblr_api_read data object is undefined!");
          return;
        }
        // -- tumblrBlogID must be pulled from Tumblr v1 API response -- 
        var tumblrBlogId = 'LeWQqtovV6GbmyI-0QBb9Q';
        // ------------------------------------------------------------
        var response = tumblr_api_read.posts;
        var len = response.length;
        var block = document.getElementById(loc);
        var embedApiHref = "https://embed.tumblr.com/embed/post/" + tumblrBlogId + "/";
        if (DEBUG) {
          console.log('++embedTumblrPosts starts');
        }
        for (var i = 0; i < len; ++i) {
          var post = response[i];
          if (DEBUG) {
            console.log("id=" + post.id);
            console.log('url-slug: ' + post['url-with-slug']);
            console.log("i=" + i + " len=" + len + " limit=" + limit);

          }
          if (typeof post.tags !== 'undefined') {
            if (DEBUG) {
              console.log('post tag array:' + post.tags);
            }
            if (post.tags.includes('hidden')) {
              if (DEBUG) {
                console.log('--Post Flagged to be hidden!');
              }
              continue;
            }
            if (tag2ignore !== null && post.tags.includes(tag2ignore)) {
              if (DEBUG) {
                console.log('--Post Flagged to be ignored! ' + tag2ignore);
              }
              continue;
            }
            if (tag2include !== null && post.tags.includes(tag2include) === false) {
              if (DEBUG) {
                console.log('--Post tag not in whitelist! ' + tag2include);
              }
              continue;
  ...