<community>of XML and SVG Developers</community>
This is a discussion on Dynamically inserting SVG in JavaScript within the SVG Questions forums, part of the SVG Forums category; I am calling this draw() function when i click on submit button from html page The problem is when i ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| The problem is when i click on submit button , js error is displaying that...... at line 23 shown in comments... that "Object doesnot support this property or method" This is my Javascript MyScript.js function draw() { document.getElementById('svgdoc').innerHTML = '<embed id = "emb_svg" name="barChart" height="400" src="Trial.svg" width="400" >'; value1 = 50; value2 = 75; var x1 = 98; var x2 = 166; var barWidth = 10; var lineBottom = 270; var lineLeftmargin = 30; var maxBarTop = lineBottom - lineLeftmargin var maxInputValue = 100; var width1 = 35; var width2 = 35; var height1 = ((value1 * maxBarTop) / maxInputValue); var y1 = lineBottom - height1; var height2 = ((value2 * maxBarTop) / maxInputValue); var y2 = lineBottom - height2; var dupsvg=document.barChart.getSVGDocument(); /* line23 */ dupsvg.getElementById("Bar1").setAttribute("x",x1) ; dupsvg.getElementById("Bar1").setAttribute("y",y1) ; dupsvg.getElementById("Bar1").setAttribute("width" ,width1); dupsvg.getElementById("Bar1").setAttribute("height ",height1); dupsvg.getElementById("Bar2").setAttribute("x",x2) ; dupsvg.getElementById("Bar2").setAttribute("y",y2) ; dupsvg.getElementById("Bar2").setAttribute("width" ,width2); dupsvg.getElementById("Bar2").setAttribute("height ",height2); } Help me ............... Thanks Kavitha |
| |||
| Quote:
|
| |||
|
If you don't get the alert means you get the error before the alert. Put an alert before and after document.getElementById('svgdoc').innerHTML. Also try it before and after var dupsvg=document.barChart.getSVGDocument(); Quote:
__________________ rogramming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook) |
![]() |
| Tags |
| dynamically, inserting, javascript, svg |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Canon Pixma Ink Cartridges
Here is a good site for Canon Pixma ink cartridges.
printer inks
We stock printer inks for all the major brands. Quality and value, the perfect combination. Free delivery and freephone too!
Hard Disk Drive Repair Recovery Manchester >>
Data Clinic performs data recovery and repairs on any crashed hard drives.
Hosting services...
Visit this site for hosting services done by professionals.
Web Development Manchester
Web development has revolutionised the way we do business. These guys in Manchester will help you.