這是jQuery代碼,適用於Firefox和IE,但不適用於Chrome瀏覽器。 我放置alert()進行調試,它不適用於chrome或safari。有任何想法嗎? ( 「locationoption」)。 的bxslider jQuery的作品,但不是$點擊(函數() 這裏是代碼:jQuery點擊不適用於Chrome瀏覽器
$(document).ready(function(){
$(".locationoption").click(function() {
var datastring = "location="+$("#locationselection").val()+"&language="+"<?php echo $language; ?>";
alert(datastring);
$.ajax({
type: "POST",
url: "includes/ajaxlocationsearch.php",
data: datastring,
cache: true,
success: function (data) {
$("#hotelselection").html(data);
}
});
});
$('#leftsidebarbanners').bxSlider({
controls:true,
nextText:" Next →",
prevText:"← Previous |",
});
});
您的開發工具中是否有任何錯誤?嘗試將alert(「Hello」)作爲點擊函數中的第一項。如果這個作品你知道這是字符串的問題。 –
你能否包含相關的html? –
您是否已經試過''('。locationoption「)on('click',function()'? – Jurik