日期:2014-05-17 浏览次数:20820 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>自动城市提示</TITLE> <link rel="stylesheet" href="css/autoCity.css" type="text/css" media="all" /> <script src="js/jquery.js"></script> <script src="js/autoCity.js"></script> <script> // 加载目的地提示List function loadAuotCityList() { $.ajax({ type: "POST", url: "remote/cityList.do", data: "cityId="+$("#beginCityId").val(), dataType:"json", success: function(result){ if(result.success) { apdata = eval(result.data); } else { alert("ERROR:" + result.data); } } }); } $(document).ready(function() { initAutoCity("targetCity"); loadAuotCityList(); // 始发车站的联动取数据 $("#beginCityId").change(function() { // 加载目的地提示 loadAuotCityList(); }); }); </script> </HEAD> <BODY> <table> <tr> <th>始发地:</th> <td> <select id="beginCityId"> <option value='hz'>杭州</option> <option value='nb'>宁波</option> </select> </td> </tr> <tr> <th>目的地:</th> <td><input type="text" id="targetCity" name="targetCity" title="如:杭州或HZ" autocomplete="off" /></td> </tr> </table> </BODY> </HTML>