Skip to content

Instantly share code, notes, and snippets.

@DeviaVir
Created March 1, 2013 11:50
Show Gist options
  • Save DeviaVir/5064161 to your computer and use it in GitHub Desktop.
Save DeviaVir/5064161 to your computer and use it in GitHub Desktop.
Fix foundation JS
// Original:
document.write('<script src=/js/vendor/'
+ ('__proto__' in {} ? 'zepto' : 'jquery')
+ '.js></script>');
// UNEXPECTED TOKEN ILLEGAL
// Should be:
document.write(unescape('%3Cscript src=/js/vendor/' + ('__proto__' in {} ? 'zepto' : 'jquery') + '.js%3E%3C/script%3E'));
@DeviaVir
Copy link
Author

DeviaVir commented Mar 1, 2013

Or use Zepto's code:

document.write('<script src=' +
('__proto__' in {} ? 'zepto' : 'jquery') +
'.js><\/script>')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment