Jump to content



Welcome to AstaHost - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!

Toggle shoutbox Shoutbox Open the Shoutbox in a popup

@  agyat : (23 May 2013 - 01:23 AM) Wow! Mr. Sb Back Home.
@  OpaQue : (23 May 2013 - 12:44 AM) Ting
@  OpaQue : (24 April 2013 - 02:44 PM) I guess, Time to run Mycent script.
@  OpaQue : (24 April 2013 - 02:43 PM) wow.. not much spam. except habatt posting lot of links.. :P
@  yordan : (23 April 2013 - 01:04 PM) You're welcome, agyat. Nice to have been helpful. Second lesson: try full words, "you" instead of "EW".
@  agyat : (23 April 2013 - 05:03 AM) @YORDAN: tHANK EW FOR YOUR FIRST LESSON.   :D
@  yordan : (22 April 2013 - 09:43 PM) @agyat : "why don't you help me", or "please help me", or "please teach us"
@  yordan : (22 April 2013 - 09:42 PM) welcome back, velma
@  velma : (22 April 2013 - 07:51 AM) **yawns** Good to be back, wonder what is going on here :)
@  agyat : (22 April 2013 - 03:50 AM) Oh! so, why don't help me learn english..
@  yordan : (21 April 2013 - 08:38 PM) The goal mentioned by shiu : "learning english, learning computer"
@  agyat : (21 April 2013 - 06:31 PM) WHAT GOAL?
@  yordan : (20 April 2013 - 10:39 AM) yes, that's our goal. simultaneouly learning English and teaching/learning computer using.
@  shiyu : (20 April 2013 - 07:30 AM) learning english,learning computer
@  yordan : (19 April 2013 - 01:11 PM) Oh, I see, it's just a trick in order to force people looking at your texte. Somehow smart, maybe.
@  agyat : (19 April 2013 - 02:54 AM) And of course I know it is not SEO friendly.
@  agyat : (19 April 2013 - 02:52 AM) There may be two possible answers for that ....


1) Shout was posted using mobile keypad.

2) To force people read content carefully and/or with more concentration.
@  agyat : (19 April 2013 - 02:49 AM) There may be two possible answers for that ....
@  yordan : (18 April 2013 - 09:35 PM) however, why this mixing of capital letters in the middle of your text?
@  agyat : (18 April 2013 - 11:10 AM) false feelings.

Photo
- - - - -

Svg In Html


1 reply to this topic

#1 FirefoxRocks

FirefoxRocks

    Super Member

  • [HOSTED]
  • 988 posts
  • Gender:Male
  • Location:Ontario, Canada
  • myCENTs:92.36

Posted 08 July 2012 - 07:38 AM

I'm designing an application for an organization and the application part is pretty much done, it's just the design part now.

Anyways, I'm given the opportunity to use nice vector icons on the user interface of the program (that along with the default icons in jQuery UI). Now I'm told that by the end of the summer, most (if not all) computers in the organization will be upgraded to Windows 7, which means that people will be accessing the application using Internet Explorer 9 (phew... at least I don't have to make it backwards compatible with IE 6).

As far as I know, Internet Explorer 9 supports SVG, however I would like to design it so that there is a fallback for PNG icons, in case someone is accessing the application from home or a computer that is still running Windows XP (the application itself isn't entirely internal, it's Internet accessible).

What is the proper way of coding this? I have seen two generally accepted solutions:

<object data='example.svg' type='image/svg+xml' width='128' height='128'>
<img src='example.png' width='128' height='128'>
</object>


Or

<!--[if lte IE 8]><img src='example.png' width='128' height='128' ><![endif]-->
<!--[if gt IE 8]><img src='example.svg' width='128' height='128'><![endif]-->
<!--[if !IE]> --><img src='example.svg' width='128' height='128'><!-- <![endif]-->


Microsoft and many others seems to recommend the first option, however I have checked in Firebug and Chrome Developer that the (non-IE) browsers download both images (PNG and SVG), which isn't a huge deal considering they're just small icons, but I would like to avoid it if possible.

I am also unsure whether either solution work with IE 7 actually, since I'm running on a development server and have no computers available to test it. There seems to be a bug in the IE Developer Tools in that even if you select IE8 or IE7, the SVG image is displayed no matter what (even without a fallback!)

Oh and I'd like to stay away from iframe and the well-known Raphael.js library, if possible.

Anyone have any input on this?

#2 Quatrux

Quatrux

    the Q

  • [HOSTED]
  • 1,669 posts
  • Gender:Male
  • Location:Lithuania, Vilnius
  • Interests:PHP, MySQL, Oracle, PL/SQL, HTML, CSS, Javascript, jQuery, C# Computers, Alternative OS, Amiga, MorphOS, Beer, Friends, Linux, KDE..
  • myCENTs:30.76

Posted 10 July 2012 - 09:22 AM

As I remember, I once needed to use SVG and needed to make it cross browser, can't find the source, but the idea was to use both methods to make it work on all browsers.

The idea was to use the IE conditions together with the object, and I've tested how it works.

Something like that:

<!--[if gt IE 5]>
..code..
<![endif]-->
<!--[if IE]> <![if !IE]> <![endif]-->
... not ie code..
<!--[if IE]> <![endif]> <![endif]-->

If it's less than IE9 to show the png image, for others to show it in an object, can't remember, but the idea might work for you to avoid sending png and svg for the same request.

By the way, as I know <!--[if !IE]> --> <!-- <![endif]--> is not valid html comment with the w3c validator and my method as I tried is valid.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users