开发者

What's the purpose of this Javascript variable?

What does this do, and why is it declared this way?

   var shroom = 'data:image/gif;base64,R0lGODlhgACAAPcAAAAAAEvlS////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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2BWm7fZCZWO49ttux+313HSjbfd6eOf/LfbeD/btN9eAd/3awcamGfLgKB0uZOJxvsm4S44r3nKekk/u7JORA4y555p3VHnnkH9eeugcjW764qtfjvpEqjMUe6CZv5567a2fnPvMcILo8Om0gx78tNAlSXO+lusu+7nFZ3n8bYizvry2MBkvOvOkSz98rA3O97v2lwofPvHVO3899bt7+Wv3Fz5PW/Sub498+fyJDP3j4K/fPHb4e8wolj+Bn//4BECdCHCAbCpgTg6IQP35RDfJa6ADYQTB7EmQTArECQMvyD0oVTB9HJwfBZVjvxACZ38G/N4FPxQUFUqQhSzZnAlhyL8SmnAs7JOJDENIQ5XskIM9PIoNLm8YRA3arneOAdMR0ZREJS5xKE00yBOREsXHTLExUbwiFpuoxb5UcSBdLAxLAgIAOw%3D%3D';


It represents a GIF image encoded in base 64.


http://en.wikipedia.org/wiki/Data_URI_scheme


It's a Data URI, which is a file encoded in a URL. More info can be found on wikipedia. Here's an online tool used to create them: http://software.hixie.ch/utilities/cgi/data/data

I believe IE doesn't have total support for Data URIs, so they're not too commonly used. If IE did, though, they'd be great for icons and small graphics embedded right into style sheets.


Here is a link to encode base 64 with Javascript

Base 64 with Javascript

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜