jquery ajax应用

<SCRIPT LANGUAGE="JavaScript" src="$webdb[www_url]/images/default/jquery-1.2.1.pack.js"></SCRIPT>
<script language="JavaScript" type="text/javascript">
		function getCity(){
			cf =jQuery.noConflict();
			var cfcf = cf('#province').val();	
			cf.post("createsecondcity.php",{pro: ""+cfcf+""},function(data){
				cf('#cfcity').html(data);
			});
		}		
</script>

<div style="float:left">城市目录:</div><select name="cf_province" id="province" style="float:left;" onChange="getCity()">
<!--
EOT;
foreach($area_DB[name] AS $key=>$value){
print <<<EOT
-->
<option value={$key}>$value</a> </option>
<!--
EOT;
}print <<<EOT
-->
</select>
	<div id="cfcity">
       <SELECT NAME="cf_city" id="city">
            <OPTION VALUE="0">请选择所在城市</OPTION>
        </SELECT>
</div>

<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<input type="submit" name="submit" value="Submit" />
</form>



createsecondcity:

<?php
require("global.php");
$city_cf=$_POST["pro"];
$show="<select NAME='cf_city' id='city'><option value='cf'>请选择城市</option>";
foreach($city_DB[$city_cf] AS $key2=>$value2)
{
		$show=$show."<option value={$key2}>{$value2}</option>";	
}
echo $show.'</select>';
?>

你可能感兴趣的:(JavaScript,html,jquery,PHP,Ajax)