firefox2.0.0.13中的问题

大家好, 在我的应用程序中,我使用三个依赖的下拉框 对于那个,我正在使用ajax将值加载在依赖的下拉下 例如a->第一个下拉盒直接从数据库表直接下载其加载值 b->基于第一个下拉次数中选择的值,将加载我的查询到数据库. c->与第二个相同 我的问题是,如果我提交,我将无法获得第二和第三个下拉列表的帖子值,但是在IE 6.0中,我能够看到帖子值. 感谢你

# 回答1

首先...请在创建请求对象的地方发布代码... 亲切的问候
# 回答2

在这里我发送我的源代码,这些代码将用于请求到数据库. 实际上,我在两个不同的文件中使用了两个单独的请求,这两个文件都我要发送 -------------------------------------------------------------第一个文件 ------------------------------------------------------------------------------------ - -

选择 | 换行 | 行号
  1. var xmlHttpp
  2.  
  3. function clientposition(formname,str)
  4.  
  5.     xmlHttpp=GetXmlHttpObject()
  6.     if (xmlHttpp==null)
  7.      {
  8.         alert ("Browser does not support HTTP Request")
  9.          return
  10.      }
  11.     var url="../../include/clientposition.php"
  12.     url=url+"?qq="+str+"&form="+formname
  13.     xmlHttpp.onreadystatechange=positionChanged; 
  14.     xmlHttpp.open("GET",url,true)
  15.     xmlHttpp.send(null)
  16. }function positionChanged() 
  17.     if (xmlHttpp.readyState==4 || xmlHttpp.readyState=="complete")
  18.     { 
  19.  
  20.         document.getElementById("position").innerHTML=xmlHttpp.responseText 
  21.  
  22.     } 
  23. }
  24. function GetXmlHttpObject()
  25. {
  26.     var xmlHttpp=null;
  27.     try
  28.      {
  29.          // Firefox, Opera 8.0+, Safari
  30.          xmlHttpp=new XMLHttpRequest();
  31.      }
  32.     catch (e)
  33.      {
  34.          //Internet Explorer
  35.          try
  36.           {
  37.               xmlHttpp=new ActiveXObject("Msxml2.XMLHTTP");
  38.           }
  39.          catch (e)
  40.           {
  41.               xmlHttpp=new ActiveXObject("Microsoft.XMLHTTP");
  42.           }
  43.     }
  44. return xmlHttpp;
  45. }

-------------------------------------------------------------第一个文件 ------------------------------------------------------------------------------------ - - --------------------------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------

选择 | 换行 | 行号
  1. var xmlHttppcan
  2.  
  3. function positioncandidate(formname,client,position)
  4.     xmlHttppcan=GetXmlHttpObject()
  5.     if (xmlHttppcan==null)
  6.      {
  7.         alert ("Browser does not support HTTP Request")
  8.          return
  9.      }
  10.     var url="../../include/positioncandidate.php"
  11.  
  12.     url=url+"?c="+client+"&p="+position+"&f="+formname
  13.     xmlHttppcan.onreadystatechange=candidateChanged; 
  14.     xmlHttppcan.open("GET",url,true)
  15.     xmlHttppcan.send(null)
  16. }function candidateChanged() 
  17. {     
  18.     if (xmlHttppcan.readyState==4 || xmlHttppcan.readyState=="complete")
  19.     { 
  20.          document.getElementById("candidate").innerHTML=xmlHttppcan.responseText         
  21.     } 
  22. }
  23. function GetXmlHttpObject()
  24. {
  25.     var xmlHttppcan=null;
  26.     try
  27.      {
  28.          // Firefox, Opera 8.0+, Safari
  29.          xmlHttppcan=new XMLHttpRequest();
  30.      }
  31.     catch (e)
  32.      {
  33.          //Internet Explorer
  34.          try
  35.           {
  36.               xmlHttppcan=new ActiveXObject("Msxml2.XMLHTTP");
  37.           }
  38.          catch (e)
  39.           {
  40.               xmlHttppcan=new ActiveXObject("Microsoft.XMLHTTP");
  41.           }
  42.     }
  43.     return xmlHttppcan;
  44. }

--------------------------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------

# 回答3

您能看一下FF的JS-Error-Console,并告诉您发现什么错误...如果有一个错误? 您如何调用Select节点的请求? on Change? 请显示一个电话... 亲切的问候
# 回答4

我只有我在FF错误控制台中看到的这两个错误,但错误1正在重复10次 错误1:document.getElementById(" invno")没有属性 源文件:http://localhost/script/loadinvoice.js 线:38 错误:FormObj.Canname没有属性 源文件:http://localhost/script/validate.js 线:1985 我们使用事件(即onfocus和onchange)从选择对象调用AJAX函数. 我为测试目的编写了单独的脚本,以上是逻辑上的,我在Mozilla和Internet Explore中都获得了帖子值. 请给我一些解决方案,我非常挣扎.
# 回答5

即使错误似乎与您当前的问题无关……您也应该修复FF首先给您的错误. 当您完成此操作时,无论问题是否持续存在...每个错误可能会在FF中成功执行JavaScript ...因此您应确保控制台没有错误... 亲切的问候

标签: Javascript

添加新评论