firefox2.0.0.13中的问题
大家好, 在我的应用程序中,我使用三个依赖的下拉框 对于那个,我正在使用ajax将值加载在依赖的下拉下 例如a->第一个下拉盒直接从数据库表直接下载其加载值 b->基于第一个下拉次数中选择的值,将加载我的查询到数据库. c->与第二个相同 我的问题是,如果我提交,我将无法获得第二和第三个下拉列表的帖子值,但是在IE 6.0中,我能够看到帖子值. 感谢你
# 回答1
首先...请在创建请求对象的地方发布代码... 亲切的问候
# 回答2
在这里我发送我的源代码,这些代码将用于请求到数据库. 实际上,我在两个不同的文件中使用了两个单独的请求,这两个文件都我要发送 -------------------------------------------------------------第一个文件 ------------------------------------------------------------------------------------ - -
选择 | 换行 | 行号
- var xmlHttpp
- function clientposition(formname,str)
- {
- xmlHttpp=GetXmlHttpObject()
- if (xmlHttpp==null)
- {
- alert ("Browser does not support HTTP Request")
- return
- }
- var url="../../include/clientposition.php"
- url=url+"?qq="+str+"&form="+formname
- xmlHttpp.onreadystatechange=positionChanged;
- xmlHttpp.open("GET",url,true)
- xmlHttpp.send(null)
- }function positionChanged()
- {
- if (xmlHttpp.readyState==4 || xmlHttpp.readyState=="complete")
- {
- document.getElementById("position").innerHTML=xmlHttpp.responseText
- }
- }
- function GetXmlHttpObject()
- {
- var xmlHttpp=null;
- try
- {
- // Firefox, Opera 8.0+, Safari
- xmlHttpp=new XMLHttpRequest();
- }
- catch (e)
- {
- //Internet Explorer
- try
- {
- xmlHttpp=new ActiveXObject("Msxml2.XMLHTTP");
- }
- catch (e)
- {
- xmlHttpp=new ActiveXObject("Microsoft.XMLHTTP");
- }
- }
- return xmlHttpp;
- }
-------------------------------------------------------------第一个文件 ------------------------------------------------------------------------------------ - - --------------------------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------
选择 | 换行 | 行号
- var xmlHttppcan
- function positioncandidate(formname,client,position)
- {
- xmlHttppcan=GetXmlHttpObject()
- if (xmlHttppcan==null)
- {
- alert ("Browser does not support HTTP Request")
- return
- }
- var url="../../include/positioncandidate.php"
- url=url+"?c="+client+"&p="+position+"&f="+formname
- xmlHttppcan.onreadystatechange=candidateChanged;
- xmlHttppcan.open("GET",url,true)
- xmlHttppcan.send(null)
- }function candidateChanged()
- {
- if (xmlHttppcan.readyState==4 || xmlHttppcan.readyState=="complete")
- {
- document.getElementById("candidate").innerHTML=xmlHttppcan.responseText
- }
- }
- function GetXmlHttpObject()
- {
- var xmlHttppcan=null;
- try
- {
- // Firefox, Opera 8.0+, Safari
- xmlHttppcan=new XMLHttpRequest();
- }
- catch (e)
- {
- //Internet Explorer
- try
- {
- xmlHttppcan=new ActiveXObject("Msxml2.XMLHTTP");
- }
- catch (e)
- {
- xmlHttppcan=new ActiveXObject("Microsoft.XMLHTTP");
- }
- }
- return xmlHttppcan;
- }
--------------------------------------------------------------------------------------------------------- - ------------------------------------------------------------------------------------
# 回答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