Skip to content
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

document.firstChild.lastChild.appendChild fails #14

Open
matthew-dean opened this issue Jan 28, 2014 · 2 comments
Open

document.firstChild.lastChild.appendChild fails #14

matthew-dean opened this issue Jan 28, 2014 · 2 comments

Comments

@matthew-dean
Copy link

With a common conditional block in the script: method, this statement fails:

document.lastChild.firstChild.appendChild(x)

It matches here as lastChild, and the first node is actually a comment, to which you cannot append a script child:

<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
@NelsonGaldeman
Copy link

change it to document.getElementsByTagName('head')[0]

@Barfield35
Copy link

Samuel Man Barfield III Net Worth?
Hacker Heights, Tx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants