如何在mouseOver事件中使用js變量?如何將JavaScript變量傳遞給onMouseOver事件
這裏是我的代碼:
<script type="text/javascript">
window.String1 = <%=GetLocalResourceStringEscaped("String1")%>;
window.String2 = <%=GetLocalResourceStringEscaped("String2")%>;
</script>
<label runat="server" id="labelWeight" onmouseout="HelpOut(this);" onmouseover="Help(this,window.String1,window.String2);">
<asp:Localize ID="LocPWeight" runat="server" meta:Resourcekey="ProductWeightInGrams"
Text="Product Weight in Grams"></asp:Localize>
</label>
,它看起來像它不以這種方式工作:)。
謝謝。 !
這是行不通的。你測試過了嗎?引號正在轉義字符串。 –