奇怪的是 xmlHttp.responseTEXT 在Safari 、搜狗等手机浏览器 这里就取不到值。
ie正常。
代码可以直接复制到html文件里面执行。
上码.....
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
<SCRIPT src="http://124.232.150.182:8080/wap_mark/back/js/lazyload-min.js" type=text/javascript></SCRIPT>
<script language="javascript"><!--
function intiWidth(){
if((window.screen.width>500||window.screen.width<450)&&window.screen.width>320){
var targetWidth = 480/window.screen.width * window.devicePixelRatio * 160;
targetDensitydpi = 'target-densitydpi=' + targetWidth + ', width=device-width,user-scalable=no';
document.getElementsByName('viewport')[0].setAttribute( 'content', targetDensitydpi );
}
}
function loadscript(){
LazyLoad.js(['http://124.232.150.182:8080/wap_mark/back/js/jquery-1.7.2.min.js'], function () {
intiWidth();
});
}
setTimeout(loadscript,1);
var xmlHttp;
var result;
function createXMLHttpRequest()
{
if (window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function getcitytown()
{
var provinceID = document.all.selectp.value
createXMLHttpRequest();
var url="http://124.232.150.182:8080/wap_mark/search.jsps?p=selTownByCity&provinceID="+provinceID;
xmlHttp.open("post",url,true);
//xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');