[svg-developers] AppleWebkit Dynamic Embedding of SVG in does not work

Wed, 02 Nov 2011 21:11:45 -0700

Hi,

I have a requirement of embeding a SVG document dynamically with javascript
inside a HTML. For this I had a <object> element with a blank "data"
attribute and then I set this data attribute with javascript.
While this works fine in Chrome and FireFox it does not work in Safari (
and other AppleWebKit browsers ). Safari is not sending a HTTP request when
the data attribute is being set. I even tried jquery to set the data
attribute but still it wont work in Safari.

Any one aware of this issue with Safari. Following is my code. I have tried
setAttribue, c.data, as well $("#test").attr(), none of them works in Safari
and all of them works in Chrome and FireFox


<html>
     <head>
          <script type="text/javascript">
            window.onload = function(){
              c= document.getElementById('test');
              
c.setAttributeNS(null,'data','http://myserver.com/SVG/MyImage.svg');
            }
         </script>
     </head>
     <body>
          <object id="test" data="" type="image/svg+xml" width="200"
height="200" />
     </body>
  </html>


[Non-text portions of this message have been removed]



------------------------------------

-----
To unsubscribe send a message to: [email protected]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to