Open fkomaralp opened 11 years ago
How do you call that script: Node's require()
or HTML <script src="…">
?
Using the normal way,
<script type="text/javascript" src="<?=assets_url()?>js/nprogress/nprogress.js"></script>
Interesting.
What's the browser?
Does the assets_url() point to some other domain?
Chrome 29. (Tested on other browsers: IE10, Opera15, FF24 I got same error) No, assets_url() working good.
But i'm fixed this problem like that.
var bodyStyle = document.body.style;
changed to
var bodyStyle = document.head.style;
. My thing is that, in generally all style properties on the head tag!.
Maybe problem's me. Please look at this web site i'm used this script on the blog area.
Used in this area http://gayretsoft.com/home/blog
Script path http://gayretsoft.com/assets/js/nprogress/nprogress.js
Function of getPositioningCSS
For me, this error is normal.
Now, script is working perfect.
@rstacruz Maybe nprogress should rather use document.getElementsByTagName('style')
or some other instrument that does not depend on the <style>
tag's location.
Could this help? https://github.com/zhouzhuojie/meteor-nprogress/issues/1
I catch this error too, I find the cause is when NProgress.start(), the
tag may not loading in page,then document.body will be null, I put the 'NProgress.start()' in bottom of the page, it is ok./ meybe $(document).ready(function () {NProgress.done()} is usefully. /
+1 Uncaught TypeError: Cannot read property 'style' of null(…). ROR 4
Problem still not solved
I'm having the same problem.
You need to call NProgress.start() in the bottom of the page, if you call in the begin will throw an exception because the body tag not was created yet.
You are probably placing the script inside the head tag. Try inserting the start() inside the body tag instead.
if you place it at the top then you can do something like:
var ngProgRun = setInterval(function () {
if (document.body != null) {
clearInterval(ngProgRun);
NProgress.start();
}
}, 10);
Hi, there is a bug "Uncaught TypeError: Cannot read property 'style' of null " on this line ; @216 // Sniff on document.body.style
var bodyStyle = document.body.style;