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

Improved CDN and analytics #1659

Closed
wants to merge 7 commits into from
Closed

Improved CDN and analytics #1659

wants to merge 7 commits into from

Conversation

BLooperZ
Copy link
Contributor

Added global function for CDN fallbacks,
Modernizr is served with CDN as well (the cdn itsef can be changed)
Made use of it on the analytics snippet
(don't mind the "x-ua-compatible" yet, still on open issue: #1656)

pros:

  • less characters:
    with modernizr fallback: 465 against 525
    without modernizr: 410 against 433
    (counted with the spaces in " || " removed)
  • xml compatible (no document.write or something that look like an element)
  • useful for make a fallback for any other script

cons:

  • can't use b as variable in scripts - can easily be changed
  • need testing to see if the analitycs snippet really works

Improved CDN fallbacks and analytics snippet
@@ -12,7 +12,11 @@

<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>

This comment was marked as abuse.

removed modernizr cdn
@BLooperZ
Copy link
Contributor Author

i updated the file to have only jquery fallback
still using the shorter analytics snippet,
please, consider the other improvements

well, if no medernizr, it can be anywhere
@BLooperZ BLooperZ changed the title Update index.html Improved CDN and analytics Jan 14, 2015
this way no need to fear from using b
FIX can't do function inside function
@arthurvr
Copy link
Member

This would make the jQuery fallback async, we don't want that. It might result in jQuery not being defined before other stuff gets executed.

@arthurvr arthurvr closed this Jan 14, 2015
@BLooperZ
Copy link
Contributor Author

i think the jquery fallback is async either way (also in current version)

@mathiasbynens
Copy link
Member

@BLooperZ <script>document.write('…');</script> is synchronous.

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

Successfully merging this pull request may close these issues.

3 participants