我在我的網頁上使用了一個jQuery表格添加行插件,它在Chrome和IE9上的本地桌面上工作正常。但當我上傳項目到服務器,它仍然在Chrome上工作正常,但沒有發生在IE9上,(有一個addrow按鈕,當我點擊它,沒有行被添加)。jquery無法在IE9上工作
你知道爲什麼會發生這種情況嗎?
我使用最新的jQuery版本。
編輯:
<table id="tblotherlicence" style="width:800px" cellspacing="2" cellpadding="3">
<tr><td class="formtitle" colspan="5">OTHER PROFESSIONAL LICENSURE<a style="font-size:7pt">(e.g.,registered psychiatric nurse; registered massage therapist; registered social worker)</a></td></tr>
<tr><td class="formlabel">Profession</td>
<td class="formlabel">Licence Number</td>
<td class="formlabel">Jurisdiction</td>
<td class="formlabel">Date of Expiry</td>
<td class="formlabel"><input class="addrow" type="button" value="Add Row" /></td></tr>
<tr>
<td><asp:TextBox ID="Licence1" runat="server"></asp:TextBox>
</td>
<td><asp:TextBox ID="LicenceNumber1" runat="server"></asp:TextBox>
</td>
<td><asp:TextBox ID="Jurisdiction1" runat="server"></asp:TextBox>
</td>
<td><asp:TextBox ID="ExpiryDate1" runat="server"></asp:TextBox></td>
<td><input class="delrow" type="button" value="Delete Row" /></td>
</tr>
</table>
<script type="text/javascript">
$(document).ready(function() {
$("#<%=ExpiryDate1.ClientID%>").datepicker({
yearRange: '1950:2015',
changeYear: true,
changeMonth: true,
257 });
$(".addrow").btnAddRow(function() {
var i;
var rowCount = $("#tblotherlicence tr").length;
for (i = 3; i <= rowCount; i++) {
$("#tblotherlicence tr:nth-child(" + i + ") td:nth-child(4) input[type='text']").attr("id", "MainPlaceHolder_RecordofNursing1_ExpiryDate" + (i - 2));
$("#tblotherlicence tr:nth-child(" + i + ") td:nth-child(4) input[type='text']").removeAttr("class");
$("#tblotherlicence tr:nth-child(" + i + ") td:nth-child(4) input[type='text']").datepicker({
yearRange: '1950:2015',
changeYear: true,
changeMonth: true,
});
}
});
$(".delrow").btnDelRow();
});
</script>
錯誤是 「SCRIPT1028:預期標識符,字符串或數字xxxxx.aspx,257行字符21」,我已標記線257這僅僅是一個閉括號
嗨,皮塔。提問時始終顯示代碼。 –
發表您的代碼或一些代碼示例jsFiddle。也許一個網頁的URL在哪裏發生? –
什麼樣的服務器?檢查瀏覽器是否存在js錯誤消息。此外,請確保ie9 –