-1
rated 0 times
[
6]
[
7]
/ answers: 1 / hits: 18004
/ 8 Years ago, thu, august 4, 2016, 12:00:00
Browser is Chrome, document.currentScript
should be supported but
index.html
<link href=css/main.css rel=stylesheet />
<script src=1.js></script>
<style>
1.js
setInterval(function() {
var fullUrl = document.currentScript.src;
console.log(fullUrl)
},2000)
Error :
1.js:4 Uncaught TypeError: Cannot read property 'src' of null
More From » javascript