for (int i = 0; i < nodes; i++) { ClientScript.RegisterStartupScript(Page.GetType(), "abc", "func('" + xPosition + "','" + yPosition + "','"+nodes+"');", true); }
function func(xPosition, yPosition, nodes) { alert(nodes); svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); // svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); // svg.setAttribute('version', '1.1'); svg.setAttribute('width', '4cm'); svg.setAttribute('height', '2cm'); svg.setAttribute('x', xPosition); svg.setAttribute('y', yPosition); mainSvg.appendChild(svg); //alert(xPosition + '","' + yPosition); rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); rect.setAttribute("id", "myrect"); rect.setAttribute("fill", "red"); rect.setAttribute("stroke", "black"); rect.setAttribute("stroke-width", "2"); rect.setAttribute("x", 5); rect.setAttribute("y", 5); rect.setAttribute("width", "150"); rect.setAttribute("height", "50"); document.body.appendChild(rect); svg.appendChild(rect); }
func('" + xPosition + "','" + yPosition + "','"+nodes+"')
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)