New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counts don't load when there are html comments on page #4

Open
actual-saurabh opened this Issue Jul 30, 2013 · 2 comments

Comments

Projects
None yet
1 participant
@actual-saurabh

actual-saurabh commented Jul 30, 2013

I get this error on line 300 of coin.js

Uncaught Error: HierarchyRequestError: DOM Exception 3

when I check on the console: document.lastChild.firstChild

It logs an html comment. and hence the counts never load. Could you filter that for html comments

@actual-saurabh

This comment has been minimized.

Show comment
Hide comment
@actual-saurabh

actual-saurabh Aug 2, 2013

If you check the nodeType to ensure if it is indeed an element and not an html comment. Better still, is there any reason why you can't select the <head> node directly instead of going the document.lastChild.firstChild way?

actual-saurabh commented Aug 2, 2013

If you check the nodeType to ensure if it is indeed an element and not an html comment. Better still, is there any reason why you can't select the <head> node directly instead of going the document.lastChild.firstChild way?

@actual-saurabh

This comment has been minimized.

Show comment
Hide comment
@actual-saurabh

actual-saurabh Aug 2, 2013

You could use document.getElementsByTagName('head') instead of that.

actual-saurabh commented Aug 2, 2013

You could use document.getElementsByTagName('head') instead of that.

mitar pushed a commit to wlanslovenija/coinwidget.com that referenced this issue Nov 16, 2013

Update coin.js
Changed head node locating code to take care of scottycc#4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment