I have a html page that has an inframe very similiar to the one Jim Ley
put out at:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test by TM 08/03</title>
</head>
<body>
<iframe name="kreise" src="kreise.svg " width="500" height="100"
frameborder="0" >
content for browsers without SVG access ...
</iframe>
</html>
The only difference is that the user is clicking on a link in
kreise.svg to get the parent document. I get "ReferencEr ror: Parent is
not defined"
kreise.svg would look like:
<svg width="1024px" height="626px" onload="initsvg (evt);" viewBox="0 0
1024 626" preserveAspectR atio="none" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="ht tp://www.w3.org/1999/xlink"
xmlns:a3="http://ns.adobe.com/AdobeSVGViewerE xtensions/3.0/"
a3:scriptImplem entation="Adobe ">
<title>Graphi c</title>
<defs>
<script language="JavaS cript">
<![CDATA[
var svgObj;
function initsvg(evt)
{
if ( window.svgDocum ent == null )
{
svgDocument = evt.target.owne rDocument;
}
svgObj = svgDocument.doc umentElement;
}
function close_graphic(e vt)
{
var obj;
obj=parent.fram es["kreise"];
alert(obj);
//parent.document .getElementById ('kreise').styl e.visibility='h idden';
}
]]>
</script>
</defs>
<a onclick="close_ graphic(evt);">
<text x="35" y="35" font-family="Arial" font-size="20" fill="#ff0000"
pointer-events="all">Cl ose</text>
</a>
</svg>
Anyone have any idea why this does not function?
Mike
put out at:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test by TM 08/03</title>
</head>
<body>
<iframe name="kreise" src="kreise.svg " width="500" height="100"
frameborder="0" >
content for browsers without SVG access ...
</iframe>
</html>
The only difference is that the user is clicking on a link in
kreise.svg to get the parent document. I get "ReferencEr ror: Parent is
not defined"
kreise.svg would look like:
<svg width="1024px" height="626px" onload="initsvg (evt);" viewBox="0 0
1024 626" preserveAspectR atio="none" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="ht tp://www.w3.org/1999/xlink"
xmlns:a3="http://ns.adobe.com/AdobeSVGViewerE xtensions/3.0/"
a3:scriptImplem entation="Adobe ">
<title>Graphi c</title>
<defs>
<script language="JavaS cript">
<![CDATA[
var svgObj;
function initsvg(evt)
{
if ( window.svgDocum ent == null )
{
svgDocument = evt.target.owne rDocument;
}
svgObj = svgDocument.doc umentElement;
}
function close_graphic(e vt)
{
var obj;
obj=parent.fram es["kreise"];
alert(obj);
//parent.document .getElementById ('kreise').styl e.visibility='h idden';
}
]]>
</script>
</defs>
<a onclick="close_ graphic(evt);">
<text x="35" y="35" font-family="Arial" font-size="20" fill="#ff0000"
pointer-events="all">Cl ose</text>
</a>
</svg>
Anyone have any idea why this does not function?
Mike
Comment