Get script path

前端 未结 13 1591
青春惊慌失措
青春惊慌失措 2020-11-30 01:21

In CSS, any image path is relative to the CSS file location.

f.ex if I put the CSS file in /media/css/mystyles.css and use something like



        
13条回答
  •  攒了一身酷
    2020-11-30 01:39

    For asynchronous scripts, script tag walking won't do. So if: - performance.timing exists (like in new non-Safari browsers) & You have not reached its max, or have pushed-up its max before loading & Your script was the most recent thing loaded:

    performance.getEntries().slice(-1)[0].name 
    

    To push-up the max, do something like this:

    performance.webkitSetResourceTimingBufferSize(10000)
    

提交回复
热议问题