The test has the same result under Firefox and ASV.
Anyone has similar problem before?
An array object defined in the html document
is passed into a function defined in the
SVG document. When I run the
instanceof Array test, it returns false.
However, all the array methods and properties
are still available as normal.
It's very weird.
html file:
<html>
<body>
<script type="text/javascript">
function _testArr()
{
var t = [12,23];
alert( "In html: " + t + " " + t.length + " " + (t
instanceof Array
) );
window.testArr( t );
}
</script>
<embed src="html-to-svg.svg"
width="200"
height="200"
type="image/svg+xml"></embed>
<noembed>Appropriate text fallback</noembed>
<form name="inputform">
<input type="button" value="Change Stroke Color"
onclick="_testArr()">
</form>
</body>
</html>
SVG file:
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xml:space="preserve" zoomAndPan="disable"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="200" height="200" onload="Initialize(evt)"
>
<script type="text/ecmascript"><![CDATA[
function Initialize()
{
parent.testArr = myfun;
}
function myfun( arr )
{
alert( "In svg " + arr + " " + arr.length + " " + (arr instanceof
Array) + " " + arr.sort);
alert( "Array defined inside1: " + ( [12,23] instanceof Array ) );
newArr = [];
for ( var i=0; i<arr.length; i++ )
newArr[i] = arr[i];
alert( "Array defined inside2: " + ( newArr instanceof Array ) );
}
]]>
</script>
<circle id='colorCircle' cx='100' cy='100' r='50' fill='yellow'
stroke='green' stroke-width='10' />
</svg>
-----
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:
mailto:[EMAIL PROTECTED]
mailto:[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/