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

Sets var insLoc to insertAfter() either id='ecssential' or HEAD.lastChild #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Using eCSSential is as easy as including the full source of eCSSential.min.js (f

<head>
...
<script>
<script id="ecssential">
<!-- Add eCSSential.min.js inline here -->

eCSSential({
Expand All @@ -57,7 +57,7 @@ Because eCSSential requires JavaScript support to perform its optimizations, you

<head>
...
<script>
<script id="ecssential">
<!-- Add eCSSential.min.js inline here -->

eCSSential({
Expand Down
4 changes: 2 additions & 2 deletions src/eCSSential.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ window.eCSSential = function( css, config ){
o = config || {},
w = window,
d = w.document,
insLoc = d.getElementsByTagName( "script" )[0],
insLoc = d.getElementById( "ecssential" ) || d.getElementsByTagName( 'head' )[0].lastChild,
whre = /(min|max)-(width|height)/gmi,
ieV = w.navigator.appVersion.match( /MSIE ([678])\./ ) && RegExp.$1,
ieRe = new RegExp( "(IE" + ieV + ")|(IE)", "g" );
Expand Down Expand Up @@ -94,7 +94,7 @@ window.eCSSential = function( css, config ){
if( defer.length ){
var div = d.createElement( "div" );
div.innerHTML = makeLinks( defer );
insLoc.parentNode.insertBefore( div, insLoc );
insLoc.insertAfter( div, insLoc );
}
// return data for testing
return { css: css, config: config, block: load, defer: defer, timedout: timedout };
Expand Down