Fixing use of globally defined variable

`scriptNode` isn't defined and breaking minification for jshint