ajax连动下拉菜单
-------------------------jsp中的js代码--------------------
<script type="text/javascript">
function ajaxFunction(sort){
var xmlHttp;
try{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
} catch (e)
{
// Internet Explorer
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}catch (e)
{
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}catch (e)
{
alert("您的浏览器不支持AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
document.getElementById("div_product").innerHTML=xmlHttp.responseText;
}
}
xmlHttp.open("POST","problemAction.do?action=showVersions",true);
xmlHttp.send(null);
}
</script
相关文档:
3.4理解继承
一.基于原型的继承:
步骤:
(1)在子类构造函数中调用基类构造函数,从而继承基类的属性。
(2)将基类的一个新实例赋给子类,从而继承基类的方法。
Samples.Cat=function()
{
Samples.Pet.call(this);
}
Sample ......
最近的项目里用到AjaxControlToolkit 3.5,项目完成以后在本地测试没问题,放到服务器上去在IE6就出现Ajax 客户端框架未能加载的问题,在FF,IE7,Opera,Safari等浏览器都没问题,真是搞不懂MS怎么搞得,现在 就想抛弃IE6,找的好辛苦啊,网上说的解决方案都试过了,都没用,最后找到的答案是:应用程序的编码问 题,只要在 ......
index.asp文件 保存utf-8
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
<form id="form1" name="form1" method="post">
<input name="ip" type="text" id="ip" style="width:170px" />
</form>
<mce:script type="text/javascript" src="ajaxrequest-m ......
/***************************by
garcon1986********************************/
Index.php:
<script type="text/javascript" src="ajax.js" ></script>
<a href="#" onclick="funphp('S')" >S</a>
<a href="for.php?url=E" >E</ ......
Ajax 给 XMLHttpReq.onreadystatechange传递参数
通过:
xmlhttp.onreadystatechange= function(){xx(123)};
or
xmlhttp.onreadystatechange= new Function("xx(123)");
就可以了。
m=document.getElementsByName("text8");
v=m[i];
XMLHttpReq.onreadystatechange=function(){proce(v)};
---------------------- ......