Anonymous
07-26-2005, 02:34 PM
Hi there,
I am stuck at this point since last two days :cry: :cry: . I have explicitely mentioned moveto character M with point, I still get this error. the peice of code where I get this error: element 'curve': path data missing a moveto
any variable starting with "js_" is a javascript variable.
curve is an svg path defined in another script language called DSP.
the partial related code is shown below. I can draw a graph for the first time, after I move a point, the graph just stays unchanged and I get the above mentioned error. I would really appreciate it if someone can show any error here.
<script language="JavaScript" type="text/javascript">
<![CDATA[
function reDraw()
trace="M"+js_X[0]+" "+js_Y[0]+"L";
for (i=1;i<js_Y.length;i++)
{trace=trace+js_X[i]+"'"+js_Y[i]+" "};
trace="' "+trace+ "' stroke='yellow' fill='none' stroke-width='5' ";
curve.setAttribute("d",trace);
alert(trace);
}
function movePoint(evt)
{
y=evt.getClientY();
js_Y[i]=(js_min + js_size*(450-y)/450);
reDraw();
}
}
]]></script>
<!-- DSP
iGraph = "<path id='curve' d='M" + js_X[0] + "," + js_Y[0];
for(i=1;i<js_Y.size;i++)
iGraph += "L" + js_X[i] + "," + js_Y[i];
iGraph += "' stroke='yellow' fill='none' stroke-width='5'/>";
graph.render();
-->
<!-- DSPOBJECT name = graph
iGraph
-->
I am stuck at this point since last two days :cry: :cry: . I have explicitely mentioned moveto character M with point, I still get this error. the peice of code where I get this error: element 'curve': path data missing a moveto
any variable starting with "js_" is a javascript variable.
curve is an svg path defined in another script language called DSP.
the partial related code is shown below. I can draw a graph for the first time, after I move a point, the graph just stays unchanged and I get the above mentioned error. I would really appreciate it if someone can show any error here.
<script language="JavaScript" type="text/javascript">
<![CDATA[
function reDraw()
trace="M"+js_X[0]+" "+js_Y[0]+"L";
for (i=1;i<js_Y.length;i++)
{trace=trace+js_X[i]+"'"+js_Y[i]+" "};
trace="' "+trace+ "' stroke='yellow' fill='none' stroke-width='5' ";
curve.setAttribute("d",trace);
alert(trace);
}
function movePoint(evt)
{
y=evt.getClientY();
js_Y[i]=(js_min + js_size*(450-y)/450);
reDraw();
}
}
]]></script>
<!-- DSP
iGraph = "<path id='curve' d='M" + js_X[0] + "," + js_Y[0];
for(i=1;i<js_Y.size;i++)
iGraph += "L" + js_X[i] + "," + js_Y[i];
iGraph += "' stroke='yellow' fill='none' stroke-width='5'/>";
graph.render();
-->
<!-- DSPOBJECT name = graph
iGraph
-->