我有aspx文件下面的代碼:jQuery代碼在瀏覽器和Mozilla Web瀏覽器而不是在Internet Explorer
<asp:GridView ID="GridView1" runat="server" ShowFooter="true"
AutoGenerateColumns="False" >
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="Button1" runat="server" Text="Active" OnClientClick="return
confirmMessage(this);" />
</ItemTemplate>
</Columns>
</asp:GridView>
我有以下的Jquery /客戶端代碼
function confirmMessage(obj)
{
if ($(obj).attr("text")=="Active")
{
return confirm("Convert from active to inactive");
}
else
{
return confirm("Convert from inactive to active");
}
}
的上述代碼在Mozilla和Chrome瀏覽器上工作正常,但在Internet Explorer的情況下,它始終執行第二個塊,即
return confirm("Convert from inactive to active");
幫助將不勝感激。
我有其他的問題和你一樣,對鉻和FF,而不是IE8-代碼工作7 –
粘貼生成的html代碼 –
您是否曾嘗試向函數'confirmMessage'中添加一個輸入參數以捕獲鏈接按鈕?例如'函數confirmMessage(link){}'然後'如果($(link).attr(「text」)==「Active」' –