This happens periodically and has been for weeks. Most of the time everything's fine, but occasionally chrome simply doesn't show JS files. Visiting the same site via another URL or viewing in incognito can fix it. Restarting the server doesn't help. I'm pretty sure it's a problem with chrome (v43.0.2357.134 v44.0.2403.107, still happens). I'm using django's runserver
, though not sure it's relevant since the html is fine, validates at w3c and I can go to the js URL and load it.
I'm not even sure how to start debugging something like this. Is it a known bug with chrome? Perhaps some flag/setting that's wrong?
UPDATE:
If I have the debugger open when I refresh I get no js. otherwise it's fine.
ANOTHER UPDATE:
Here's my file structure:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="test.js" ></script>
</head>
<body>
</body>
</html>
Here's the javascript in test.js
.
alert("hi");
When I refresh this page (opened by double clicking the file) with the debugger open, alert
doesn't run and the js file doesn't appear in the "Sources" tab. The same behaviour when inlining the js.
Think this pretty much sums it up.
The Disable JavaScript
option does not disable JS globally, but only when the dev tools are open on page load. Most of the time I was only bringing up the dev tools to check on a errors and inspect the page after it had loaded.
If it ever worked then, go to F1 (i.e) setting of the developer tool. then select (restore detauls and reload.) All should be fine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With