我正在使用以下JQuery 1.4.2,它运行正常。 但是,如果我使用Jquery 1.8.3,这将停止工作。
$(document).ready(function() {
$('.time-location').change(function(){
var from = $('.time-location').val();
var dataString = "&from=" + from;
$.ajax({
type: "GET",
url: "loadajax.php",
data: dataString,
success : function(data){
$('.world-time').show();
$('.world-time').html(data);
}
});
});
});
<div id="time-location-box">
<div class="world-time" id="world-time" >
<?php include('loadajax.php');?>
</div>
<div id="time-location-sel-box">
<select class="time-location" name="time-location" id="time-location">
<option value="America/New_York">Washington DC,US(EST</option>
<option value="America/New_York">NewYork, US(EST)</option>
<option value="America/Chicago">Chicago, US(CST)</option>
</select>
</div>
</div>
我也尝试改变成功:功能完成:功能因为它似乎被弃用但却没有帮助。