Skip to content

Instantly share code, notes, and snippets.

@getify
Created July 20, 2010 15:12
Show Gist options
  • Save getify/483080 to your computer and use it in GitHub Desktop.
Save getify/483080 to your computer and use it in GitHub Desktop.
<script src="data:text/javascript,alert('hello world');"></script>
<script>alert("hello world");</script>
@mathiasbynens
Copy link

I seriously doubt data URLs for script elements are useful.

Zoompf had the following to say about that: http://twitter.com/zoompf/status/13407235637

@getify
Copy link
Author

getify commented Jul 20, 2010

mathias -- @fearphage pointed out that, for browsers that support script data-uris, the load/error events would fire, whereas not with inline script blocks. this might have a limited use in the context of using "defer" on script tags.

@mathiasbynens
Copy link

That’s good to know!

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