jQuery and svg files

jQuery and svg files

Hi all,
I am developing a website and want to implement svg files to help in regards to retina displays, but want a fall back png file as a back up. 
This is the html/js;
  1. <div id="band">
  2. </div> <!--band--> 

  3. <script>
  4.             $(document).ready(function() {
  5.                     if (Modernizr.inlinesvg) {
  6.                     //SVG.
  7.                 $('#band').html('<img src="barbGradient.svg"  />');
  8.                     } else {
  9.                     //No SVG.
  10.                 $('#band').html('<img src="barbGradient.png"  />');
  11.                 }
  12.              });
  13.     </script>
this is the css:
  1. }

  2. .no-inlinesvg div#band {
  3. position: relative;
  4. top: -950px;
  5. background-repeat: repeat-x;
  6. background-image: url('../_images/barbGradient.png');
  7. z-index: -1;

  8. }

  9. .inlinesvg div#band {
  10. position: relative;
  11. top: -950px;
  12. background-repeat: repeat-x;
  13. background-image: url('../_images/barbGradient.svg');
  14. z-index: -1;
  15. }
All the browsers are rendering horribly! I know I can include two pngs at different resolution, but I find the js method to be smarter! Any help would be appreciated!