By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 937 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

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

P: n/a
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("on click","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").setAttribu te("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>
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 30 Aug 2003 16:47:15 -0700, t.*******@tu-bs.de (Torsten Reiners)
wrote:
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.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #2

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

ji*@jibbering.com (Jim Ley) wrote in message news:<3f****************@news.cis.dfn.de>...
On 30 Aug 2003 16:47:15 -0700, t.*******@tu-bs.de (Torsten Reiners)
wrote:
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

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.

Jul 20 '05 #3

P: n/a
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.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #4

P: n/a
Jim Ley wrote:
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
--
SVG - Learning By Coding
<http://www.datenverdrahten.de/svglbc/>
Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.