2010-08-24 34 views
1

我上最後一行在這裏得到這個錯誤:錯誤上線127在列19:AttValue:「或」預期

 <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 867.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(); /> 

沒有人知道爲什麼

這裏是文件結構?

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

+0

我道歉,我修改了問題 – 2010-08-24 19:50:50

回答

7

你需要確保你的XML結構良好,與各地的屬性引號因此,此位:

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

應該是:

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

您的更新後,此位:

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

應使用entity references轉義:

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

SO顯示它在問題中的顏色標示,太。 – 2010-08-24 19:48:28

2

在XHTML中你必須把屬性值左右引號:

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

注意,我改變了引號的字符串周圍的Javascript功能來撇號。這說起來容易寫入和讀取比屬性值轉義引號:

onmouseover="tooltip.show(&quot;Testing 123&quot;);" onmouseout="tooltip.hide();" 
相關問題