Get js script file path problem

    var jsPath = doc.currentScript ? doc.currentScript.src : function(){
      var js = doc.scripts
      ,last = js.length - 1
      ,src;
      for(var i = last; i > 0; i--){
        if(js[i].readyState === "interactive"){
          src = js[i].src;
          break;
        }
      }
      return src || js[last].src;
    }();

Why should we judge this js[ I] .readyState = "interactive"?" here? Can"t I get the last src directly? And it is found that js[ I] .readyState is basically underfind

.
Mar.12,2021

may be dealing with the problem of script asynchronous loading.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb1e9d-2397.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb1e9d-2397.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?