Strange behaviour of IE using SVG (<object ... >

T

Torsten Reiners

Hi,

it might be a simple solution but I do not see it. The problem is that
I have the following file stored on my local harddrive. All references
are URL to a remote computer. It is working, i.e. the code is not
throwing an error (btw the field should link to other pages by
clicking them).

The strange behavior is, that I copy the file to the remote computer
and execute it by typing http://www.smartframe.de/dumm.html (everybody
can try and check that it is an exact copy of the code below).
Internet explorer throws an error (Object expected) where I ask for
the getSVGDocument.

Witihn IE (6.0.28, latest SVG Plugin) I enabled the execution of JS
over domains.

Please help because I have no idea anymore but assume that it is a
simple solution. It is driving me nuts.

Thanks
Torsten

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


<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css"
href="http://www.smartframe.de/static_content/css/treiners.css">
<script src="http://www.smartframe.de/applets/smartbars/SmartBar.js"
type="text/javascript"></script>

</head>
<body onload="initializefct()">
<script xmlns:smartframe="http://www.smartframe.de/xsl"
xmlns:cinclude="http://apache.org/cocoon/include/1.0"
xmlns:xsp="http://apache.org/xsp" type="text/ecmascript">function
initializefct()
{
initialize_object127();
} </script>


<!-- other html code -->

<script type="text/ecmascript">
function jump_to_uri(target) {
document.location.href(target); }
function initialize_object127()
{
var obj = document.object127.getSVGDocument();


obj.getElementById("BUTTON_MS_G").setAttribute("onclick","jump_to_uri('http://www.smartframe.de:8080/cocoon/smartframe/main.xsp?identifier=treiners_2002-11-05T15:04_01:00')");

obj.getElementById("BUTTON_PROD_LOG_G").setAttribute("onclick","jump_to_uri('http://www.smartframe.de:8080/cocoon/smartframe/main.xsp?identifier=treiners_2002-11-05T15:01_01:00')");
}
</script>

<object type="image/svg+xml"
data="http://www.smartframe.de/lomobjects/me/vorms/tp3/media/svg/treiners_2003-02-05T180003_0100.svg"
width="600" name="object127" height="300"> </object>


</body>
</html>
 
J

Jim Ley

Witihn IE (6.0.28, latest SVG Plugin) I enabled the execution of JS
over domains.

Object is broken it accesses the file from the cache, not the remote
site, so you fall into cross domain scripting problems. Object also
doesn't specify what should happen with links executed in the object
(it's supposedly a replacement for both embed and IFRAME yet they have
different behaviour, and neither is defined in the spec, a severe
problem with OBJECT)

IFRAME is the appropriate way to go, then you can access the svg
document with

iFramename.document.embeds[0].svgDocument

It's IE specific still of course, but then if you gave a toss about
other browser/viewer combinations you wouldn't be doing the
browser-doc communication.

Jim.
 
T

Torsten Reiners

Thank for the quick reply. Sounds good but might cause other problems
(which are not necessarily applicable within this group, but ...).

Witihn IE (6.0.28, latest SVG Plugin) I enabled the execution of JS
over domains.

Object is broken it accesses the file from the cache, not the remote
site, so you fall into cross domain scripting problems. Object also
doesn't specify what should happen with links executed in the object
(it's supposedly a replacement for both embed and IFRAME yet they have
different behaviour, and neither is defined in the spec, a severe
problem with OBJECT)

IFRAME is the appropriate way to go, then you can access the svg
document with

iFramename.document.embeds[0].svgDocument

Using IFRAME requires a webpages and a further embed. My problem is
that these pages are genereated and, therefore, I habe a main webpage
with the IFRAME but can not supply a further page with a complete
web-page-structure and further embeds. For IE, it should be okay to
directly reference the svg-gfx within the src-attribute but (compared
to a direct call from local harddisk-drive, I get the following
message

----

Das Verwenden von Standard-Namespacedeklarationsattributen wird in DTD
nicht unterstützt. Fehler beim Bearbeiten der Ressource
'http://www.smartframe.de/lomobjects/me/vorms/tp3/media/svg/treiners_2003-02-05T180003_0100.svg'.
Zeile 6, Position 6

<svg>

(engl: The Usage od StandardNamespacedeclarationattributes is not
supported in the DTD. Error processing the resource http:.... Line 6
pos 6.

--

Probalby should check the groups for help with this error.

Or is there another solution to my orignal problem.

Thanks
Torsten
 
J

Jim Ley

On 31 Aug 2003 03:45:56 -07
IFRAME is the appropriate way to go, then you can access the svg
document with

iFramename.document.embeds[0].svgDocument

Using IFRAME requires a webpages and a further embed.

No it doesn't

<object data="foo.svg">
and
<iframe src="foo.svg">

are the same, no extra documents needed.
For IE, it should be okay to
directly reference the svg-gfx within the src-attribute but (compared
to a direct call from local harddisk-drive

For any UA, remember OBJECT is supposedly just a replacement for
IFRAME.
Probalby should check the groups for help with this error.

You're not sending an SVG mime-type, and IE is treating it as an XML
document, you need to make sure your server is sending image/svg+xml

Jim.
 
T

Thomas Meinike

Jim said:
Sorry, you are of course correct, a mistake of mine, window is
directly accessible, document isn't, so to get to the document you
need:

iFramename.document.embeds[0].window.svgDocument

Thanks for the hint, it works.

I used the window object erlier in the "embed element" context for
setting values for variables in embedded SVG documents:
document.embeds[...].window.variable=value;

cu, Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top