this is a strange one. I have a collection of VML objects created dynamically in javascript. The system I'm using to test is IE6 on Windows XP (SP3)
When you press the mouse down on the collection, it throws a weird 'Failed' error. The really strange thing is that I've been working with VML for a while and I swear this error wasn't happening as of last week.
At any rate, here is a link to a demo which shows the error.
http://www.codequark.com/vml-demo
The error is:
Line:25 Char:5 Error:Failed Code:0
Lovely. I'm using IE6, but it would be helpful to know if it's happening in 7 or 8.
Here are the only other references to anything close to this error I've been able to find:
http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/dfacff65-cd23-480f-a2e9-c928e63cb50f/
My website keeps crashing IE, can't debug
If you want, here is the source code. You can load it up and view it in the barbaric IE browser of your choice.
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" charset="utf-8">
//the stage element.
var stage;
//create a group with a single square shape.
function makeAScaledRotatedGroup(sclX, sclY, rot, clr) {
var xCoord = 200;
var yCoord = 200;
var regX = 100;
var regY = 100;
var origX = -10/sclX + regX;
var origY = -10/sclY + regY;
var _x = xCoord - 10;
var _y = yCoord - 10;
var grp = document.createElement('<v:group style="position:absolute; left:'+_x+'px; top:'+_y+'px; width:20px; height:20px; rotation:'+rot+';" coordsize="'+20/sclX+' '+20/sclY+'" coordorigin="'+origX+' '+origY+'" class="rvml">');
var shp1 = document.createElement('<v:shape fillcolor="'+clr+'" strokecolor="red" strokeweight="2px" coordorigin="0 0" coordsize="20 20" style="position:absolute; top:0px;left:0px;width:20px;height:20px;" class="rvml">');
var pth1 = document.createElement('<v:path v="M 0 0 L 200 0 200 200 0 200 X E" class="rvml">');
shp1.appendChild(pth1);
grp.appendChild(shp1);
stage.appendChild(grp);
return grp;
}
//array to store references to all the dom nodes.
var allRects = [];
//kick it off. mon calamari cruisers beware.
function operationalBattleStation() {
document.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
document.namespaces.add("v", "urn:schemas-microsoft-com:vml");
stage = document.createElement('div');
stage.style.position = 'absolute';
stage.style.top = '0px';
stage.style.left = '0px';
stage.style.width = '500px';
stage.style.height = '500px';
stage.style.clip = "rect(0px,500px,500px,0px)";
document.body.appendChild(stage);
var clrs = ['#0066CC', '#990000','#FF0033','#0699CC','#00FF00','#0000FF','#FF0000','#33FF00','#333300', '#990000','#FF0033','#0699CC','#00FF00','#0000FF','#FF0000','#33FF00','#333300'];
var rot =0;
var scl = 1;
for(var h=0; h<clrs.length; h++) {
allRects.push(makeAScaledRotatedGroup(scl, scl, rot, clrs[h]));
rot+=10;
scl = scl*0.7;
}
};
</script></head><body onload="operationalBattleStation();"></body></html>
Any help is appreciated. Thanks!