开发者

error on line 127 at column 19: AttValue: " or ' expected

开发者 https://www.devze.com 2023-01-13 12:36 出处:网络
i am getting this error on the last line here: <path d=\"M 909.99146,226.40625 L 911.86646,228.4375 L 914.05396,232.03125 L 914.05396,233.90625 L 912.02271,238.4375 L 910.14771,239.0625 L 906.866

i am getting this error on the last line here:

       <path 
   d="M 909.99146,226.40625 L 911.86646,228.4375 L 914.05396,232.03125 L 914.05396,233.90625 L 912.02271,238.4375 L 910.14771,239.0625 L 906.86646,242.03125 L 902.17896,247.34375 C 902.17896,247.34375 901.55396,247.34375 900.92896,247.34375 C 900.30396,247.34375 899.99146,245.3125 899.99146,245.3125 L 898.27271,245.46875 L 897.33521,246.875 L 894.99146,248.28125 L 894.05396,249.6875 L 895.61646,251.09375 L 895.14771,251.71875 L 894.67896,254.375 L 892.80396,254.21875 L 892.80396,252.65625 L 892.49146,251.40625 L 891.08521,251.71875 L 889.36646,248.59375 L 887.33521,249.84375 L 888.58521,251.25 L 888.89771,252.34375 L 888.11646,253.59375 L 888.42896,256.5625 L 888.58521,258.125 L 887.02271,260.625 L 884.21021,261.09375 L 883.89771,263.90625 L 878.74146,266.875 L 877.49146,267.34375 L 875.92896,265.9375 L 872.96021,269.375 L 873.89771,272.5 L 872.49146,273.75 L 872.33521,277.96875 L 870.81081,285.33474 L 868.43097,284.21747 L 867.96221,281.24871 L 864.21221,280.15496 L 863.89971,277.4987 L 856.86844,254.8424 L 852.26199,240.56238 L 854.62208,240.22882 L 856.08521,240.625 L 856.08521,238.125 L 856.86646,232.8125 L 859.36646,228.28125 L 860.77271,224.375 L 858.89771,222.03125 L 858.89771,216.25 L 859.67896,215.3125 L 860.46021,212.65625 L 860.30396,211.25 L 860.14771,206.5625 L 861.86646,201.875 L 864.67896,193.28125 L 866.71021,189.21875 L 8开发者_如何学运维67.96021,189.21875 L 869.21021,189.375 L 869.21021,190.46875 L 870.46021,192.65625 L 873.11646,193.28125 L 873.89771,192.5 L 873.89771,191.5625 L 877.80396,188.75 L 879.52271,187.03125 L 880.92896,187.1875 L 886.71021,189.53125 L 888.58521,190.46875 L 897.33521,219.375 L 903.11646,219.375 L 903.89771,221.25 L 904.05396,225.9375 L 906.86646,228.125 L 907.64771,228.125 L 907.80396,227.65625 L 907.33521,226.5625 L 909.99146,226.40625 z M 889.76025,255.5448 L 891.24463,254.06042 L 892.57276,255.07605 L 893.11964,257.41981 L 891.47901,258.27919 L 889.76025,255.5448 z M 896.24465,249.84166 L 897.9634,251.63854 C 897.9634,251.63854 899.21341,251.71666 899.21341,251.40416 C 899.21341,251.09166 899.44778,249.45103 899.44778,249.45103 L 900.30716,248.66978 L 899.52591,246.95102 L 897.57278,247.65415 L 896.24465,249.84166 z"
   id="ME"
   style="fill:#f2d0ff" onmouseover=tooltip.show("Testing 123"); onmouseout=tooltip.hide(); /> 

does anyone know why?

here is the file structure:

https://stackoverflow.com/questions/3560412/is-it-possible-to-run-javascript-from-within-svg


You need to make sure that your xml is well formed, with quotes around the attributes. So this bit:

onmouseover="tooltip.show('Testing 123'); /> 

should be:

onmouseover="tooltip.show('Testing 123');" />

After your update, this bit:

onmouseover="tooltip.show('Testing 123 <strong>Tes...')"

should be escaped using entity references:

onmouseover="tooltip.show('Testing 123 &lt;strong&gt;Tes...')"


You forget the " in the end after );


You're missing a " at the end of the onmouseover?


In XHTML you have to put quotation marks around the attribute values:

onmouseover="tooltip.show('Testing 123');" onmouseout="tooltip.hide();"

Notice that I changed the quotation marks around the string in the Javascript to apostrophes. That's easier to write and read than escaping quotation marks in the attribute values:

onmouseover="tooltip.show(&quot;Testing 123&quot;);" onmouseout="tooltip.hide();"
0

精彩评论

暂无评论...
验证码 换一张
取 消