Comments (12)
@rachelnabors you could load the script dynamically with JS using the same test as svg4everybody.
<script type='text/javascript'>
(function(d,s,p){
if(/Trident\/[567]\b/.test(navigator.userAgent)||(navigator.userAgent.match(/AppleWebKit\/(\d+)/)||[])[1]<537){
var _s=d.createElement(s),
_r=d.getElementsByTagName(s)[0];
_s.async=1;
_s.src=p;
_r.parentNode.insertBefore(_s,_r);
}
})(document,'script','your-path/svg4everybody.min.js');
</script>
I didn't test the code in IE but if you inline it in your html it should do the trick.
from svg4everybody.
The script already checks the browser for that, so there is no need to load it conditionally.
The problem is that it cannot detect all the affected browsers, and depending on the user agent is highly unreliable anyway.
from svg4everybody.
Hmm, I was trying to reduce an HTTP request for browsers that don't need
this.
On Thu, Apr 9, 2015 at 1:49 PM János Erdei-Csóka [email protected]
wrote:
The script already checks the browser for that, so there is no need to
load it conditionally.The problem is that it cannot detect all the affected browsers, and
depending on the user agent is highly unreliable anyway.—
Reply to this email directly or view it on GitHub
#50 (comment)
.
from svg4everybody.
That's great but I don't think you should rely on svg4everybody, unless you change it to always inline your SVG content.
If you use SVG for icons you are much better off with Grunticon or any other solution that embeds the SVG in CSS. Which by the way is even better if your goal is to reduce the number of HTTP requests.
from svg4everybody.
It's an interactive piece, and for that reason, a number of SVGs must be
physically present on the page.
On Thu, Apr 9, 2015 at 2:11 PM János Erdei-Csóka [email protected]
wrote:
That's great but I don't think you should rely on svg4everybody, unless
you change it to always inline your SVG content.If you use SVG to display icons you are much better off with grunticon
https://github.com/filamentgroup/Grunticon or any other solution that
embeds the SVG in CSS. Which by the way is even better if your goal is
reducing the number of HTTP requests.—
Reply to this email directly or view it on GitHub
#50 (comment)
.
from svg4everybody.
@Vorzard, same question about SVGs in a sprite map. Can you style them via CSS with grunticon? I think the target of grunticon is different. They're both awesome, but just target different scenarios. This project is more about using SVG capabilities than just loading vectors as images.
from svg4everybody.
Wouldn't it be better to use moderniser to do the checking for capabilities ?
On 9 Apr 2015, at 23:08, Jonathan Neal [email protected] wrote:
@Vorzard, same question about SVGs in a sprite map. Can you style them via CSS with grunticon? I think the target of grunticon is different. They're both awesome, but just target different scenarios. This project is more about using SVG capabilities than just loading vectors as images.
—
Reply to this email directly or view it on GitHub.
from svg4everybody.
I took a look at modernizr, but it doesn't have a way to check for ,
nor does it sniff browser versions.
On Thu, Apr 9, 2015 at 3:34 PM deantpt [email protected] wrote:
Wouldn't it be better to use moderniser to do the checking for
capabilities ?On 9 Apr 2015, at 23:08, Jonathan Neal [email protected] wrote:
@Vorzard, same question about SVGs in a sprite map. Can you style them
via CSS with grunticon? I think the target of grunticon is different.
They're both awesome, but just target different scenarios. This project is
more about using SVG capabilities than just loading vectors as images.—
Reply to this email directly or view it on GitHub.—
Reply to this email directly or view it on GitHub
#50 (comment)
.
from svg4everybody.
If you use svg4everybody as it is currently only a couple of WebKit browsers wouldn't work, such as Safari 7.0, and some of those less popular smartphone browsers. The problem is that future Internet Explorers will require intervention. The bigger problem is that under some network conditions svg4everybody would not be able to rely on the user agent.
Grunticon also has the same capability as svg4everybody, but for an interactive content it wouldn't be any better.
from svg4everybody.
@Vorzard Do you know of specific svg4everybody bugs with Safari 7? I remember it working fine in my tests. Also the script has UA sniffing for versions below 7 (AppleWebKit < 537).
from svg4everybody.
from svg4everybody.
With Edge holding out, conditional comments is simply not the way to conditionally load this script. You would unfortunately be better off using a loader and perhaps combining that with a list of user agent sniffs.
from svg4everybody.
Related Issues (20)
- Not working for MS Edge HOT 3
- can't make href work using svg4everybody HOT 1
- svg4everybody is not defined
- Add workaround for SVG print bug in Firefox
- svg-chrom HOT 1
- SVG transform animateTransform not working in IE11 and Edge 42
- linearGradient for svg4everybody HOT 2
- run the polyfill only on selected dom element and its children
- Validate Not Running After Page Start
- Inlining External SVG
- Inlining External SVG from sprite, SVG doesn't display correctly HOT 3
- PreserveAspectRatio attribute is stripped out on IE11
- Add option to always replace contents ignoring browser support HOT 2
- Empty XHR embeds after splice(0)
- import does not seem to work properly
- Generate png from svg
- Svg4everybody not working on all svgs in IE11 HOT 2
- Suggestion: Suggest loading the script with the nomodule attribute HOT 2
- Issue with iPhone5 / Safari6
- Link to kartikprabhu.com "Inline SVG Icons" is broken; Archive.org link provided
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg4everybody.