html - Data Protocol URl -
what reliable way use data uris images? know ie6/7 don't support them, work?
- i use data uris images default
- if browser ie6/7 shows image (not data actual image) using javascript
- include image (not data) in
<noscript>
.
my question is: image fetched in <noscript>
if browser supports javascript , data uris?
if want go down road (and not bother), could it...
// parse user agent , figure out if browser supports data // uris - e.g. `supportdatauri()`. also, store image path // somewhere - i'll assume convenience attribute called `data-image-src` if ( ! supportdatauri()) { var images = document.getelementsbytagname('img'); (var = 0, imageslength = images.length; < imageslength; i++) { var imgsrc = images[i].getattribute('data-image-src'); images[i].src = imgsrc; } }
Comments
Post a Comment