473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
4 6049
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
6
by: Christopher Benson-Manica | last post by:
(I posted this as a reply to my thread about iframes, but I think it may get mostly ignored there.) http://ataru.gomen.org/files/test.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"...
4
by: KC | last post by:
Could some one explain to me the casting rules for sending generic lists, ex. List<Person>, to a function that accepts List<object>? I cannot get the following easy-cheesy app to work. I get the...
1
by: easy.lin | last post by:
.... <object id="10">door</object> .... I try to write this in clipse XSD editor <element name="object" type="string"> <attribute name="id" type="int"></attribute> </element> but get wrong...
4
by: colson | last post by:
Hi, If I have a class A, and a List<List<object>> containing instances of A. How do I explicitly cast List<List<object>> as List<List<A>>?
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
9
by: Stephan Steiner | last post by:
Hi I seem to have a bit of trouble understanding one bit of how generics work: In C#, every class automatically derives from object, and inherits a bunch of properties (i.e. ToString()). Thus,...
4
by: Alan Silver | last post by:
Hello, I have an <objecttag that is used to display a Flash file. I would like the whole Flash file to be a link. The obvious thought would be to do this... <a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.