字体:  

ajax传递不了参数

jaaliu 发表于: 2008-8-28 10:42 来源: PHPChina 开源社区门户

ajax传递不了参数
ajax xmlHttp.send方法为何传递不了参数呀,希望高手指教 代码如下:

   function getData()
   {
    if(xmlHttp != null)
    {   
      xmlHttp.onreadystatechange = httpStateChange;
      xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded utf-8");
      xmlHttp.open("POST","MyJsp.jsp",true);
      var color=document.getElementById("SelColor").value
     xmlHttp.send("colorValue="+color);
   }
</script>

为什么我在另一个页MyJsp.jsp页面中得不到xmlHttp.send(colorValue="+color+")中的colorValue值呢

[ 本帖最后由 jaaliu 于 2008-8-28 10:57 编辑 ]

最新回复

clearchen at 2008-8-28 13:07:53
你没有传递参数啊,找找ajax的代码看看