S
Sunny
Hi,
I am creating an Element on page in Firefox.
But It gives me an error in Firefox.
String contains an invalid character" code: "5
[Break on this error] county[c] = document.createElement('"' +
countyVMLtext + '"');
I am adding a SVG shape to the page.
Here is the Shape :
<svg viewBox="555 322 56 53" height="53px" width="56px"
style="position: absolute; left: 555px; top: 322px; z-index: 1000;"
overflow="visible" version="1.1"><path fill-rule="evenodd" fill-
opacity="1" fill="#FFFFFF" stroke-width="1px" stroke-opacity="0.6"
stroke="#0000ff" d="M598,328 L602,327 L605,323 L607,328 L610,328
L607,338 L602,349 L603,354 L600,367 L556,374 L560,363 L559,353
L565,342 L565,336 L564,334 L598,328" stroke-linecap="round" stroke-
linejoin="round"></path></svg>
Here is my Javascript:
var shps = document.getElementsByTagName("svg");
lastshp = shps.length
shps2 = shps.item(0).parentNode
var resptext = req.responseText
countyVMLArray = resptext.split("<svg")
for(var c=1; c!= countyVMLArray.length; ++c){
color = "#FFFFFF"
countyVMLtext = "<svg" + countyVMLArray[c]
alert(countyVMLtext);
county[c] = document.createElement('"' + countyVMLtext + '"');
shps2.appendChild(county[c]);
county[c].setAttribute("fillcolor", "#FF8040");
}
lastshp = shps.length
*******************************************************************************
I am loading this shapes from xml file. XML is loading properly. And
the code works in IE Fine but not in Firefox
Why?
I am creating an Element on page in Firefox.
But It gives me an error in Firefox.
String contains an invalid character" code: "5
[Break on this error] county[c] = document.createElement('"' +
countyVMLtext + '"');
I am adding a SVG shape to the page.
Here is the Shape :
<svg viewBox="555 322 56 53" height="53px" width="56px"
style="position: absolute; left: 555px; top: 322px; z-index: 1000;"
overflow="visible" version="1.1"><path fill-rule="evenodd" fill-
opacity="1" fill="#FFFFFF" stroke-width="1px" stroke-opacity="0.6"
stroke="#0000ff" d="M598,328 L602,327 L605,323 L607,328 L610,328
L607,338 L602,349 L603,354 L600,367 L556,374 L560,363 L559,353
L565,342 L565,336 L564,334 L598,328" stroke-linecap="round" stroke-
linejoin="round"></path></svg>
Here is my Javascript:
var shps = document.getElementsByTagName("svg");
lastshp = shps.length
shps2 = shps.item(0).parentNode
var resptext = req.responseText
countyVMLArray = resptext.split("<svg")
for(var c=1; c!= countyVMLArray.length; ++c){
color = "#FFFFFF"
countyVMLtext = "<svg" + countyVMLArray[c]
alert(countyVMLtext);
county[c] = document.createElement('"' + countyVMLtext + '"');
shps2.appendChild(county[c]);
county[c].setAttribute("fillcolor", "#FF8040");
}
lastshp = shps.length
*******************************************************************************
I am loading this shapes from xml file. XML is loading properly. And
the code works in IE Fine but not in Firefox
Why?