我一直在努力在Firefox上獲得這個工作。希望有人幫助我!asp.net上的簡單jquery在firefox上不起作用
基本上; Firefox忽略按鈕點擊功能,它的子功能和按鈕張貼頁面,而不是運行jQuery代碼。
它適用於IE和Chrome,但不適用於Firefox。
非常感謝您的幫助。
下面是輸出代碼:
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$(".CatList li").click(function() {
if ($(this).is(".selected")) {
$(this).attr("class", "");
$('#ctl00_ContentPlaceHolderRight_CatChanged').val(1);
return false;
}
else {
$(this).attr("class", "selected");
$('#ctl00_ContentPlaceHolderRight_CatChanged').val(1);
return false;
}
});
$("#ctl00_ContentPlaceHolderRight_btnSave").click(function() {
var elements = $("li.selected");
if (elements.val() == null) {
alert("You must select at least one category");
return false;
}
else {
elements.each(function() {
$('#ctl00_ContentPlaceHolderRight_CatChecked').val($('#ctl00_ContentPlaceHolderRight_CatChecked').val() + "," + $(this).attr("id"));
return true;
});
}
});
});
</script>
你確定你說過「它在IE上工作,並沒有在FF工作嗎?」 :) – Shoban 2010-07-28 16:34:58