Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/400.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法使用JSON将数据库值从下拉列表中的选定值解析为文本框_Javascript_Php_Jquery_Json - Fatal编程技术网

Javascript 无法使用JSON将数据库值从下拉列表中的选定值解析为文本框

Javascript 无法使用JSON将数据库值从下拉列表中的选定值解析为文本框,javascript,php,jquery,json,Javascript,Php,Jquery,Json,我正在尝试将数据库中的数据解析到数据库中的文本框中。然而,在浏览了这里的许多问题之后,我找不到适合我的解决方案。这是我的密码: Edit.php Kinder应用程序-编辑 正文{背景图像:url/KinderApp/images/Untitled-1.png;背景重复:无重复;}] 标题{颜色:黑色;背景颜色:白色;} 页脚{颜色:绿色;背景颜色:浅灰色;} h1{字体系列:连环画,连环画MS,草书;字体大小:50px;} h6{字体系列:连环画,连环画MS,草书;字体大小:15px;颜色:

我正在尝试将数据库中的数据解析到数据库中的文本框中。然而,在浏览了这里的许多问题之后,我找不到适合我的解决方案。这是我的密码:

Edit.php

Kinder应用程序-编辑 正文{背景图像:url/KinderApp/images/Untitled-1.png;背景重复:无重复;}] 标题{颜色:黑色;背景颜色:白色;} 页脚{颜色:绿色;背景颜色:浅灰色;} h1{字体系列:连环画,连环画MS,草书;字体大小:50px;} h6{字体系列:连环画,连环画MS,草书;字体大小:15px;颜色:红色;字体大小:粗体;} span{字体系列:连环画,连环画MS,草书;字体大小:15px;颜色:蓝色;} 功能显示{ var refresh=1000;//刷新率(毫秒) mytime=setTimeout'display\u ct',刷新 } 功能显示{ var strcount var x=新日期 document.getElementById'ct'.innerHTML=x; tt=显示器; } 函数showModulestr { 如果str== { document.getElementById.value=; 回来 } if window.XMLHttpRequest {//IE7+、Firefox、Chrome、Opera、Safari的代码 xmlhttp=新的XMLHttpRequest; } 其他的 {//IE6、IE5的代码 xmlhttp=新的ActiveXObjectMicrosoft.xmlhttp; } xmlhttp.onreadystatechange=函数 { 如果xmlhttp.readyState==4&&xmlhttp.status==200 { var data=JSON.parsexmlhttp.responseText; { document.getElementByIdname.value=data.mname; document.getElementByIddesc.value=data.mdesc; document.getElementByIdicon.value=data.micon; document.getElementByIdvers.value=data.mvers; document.getElementByIdloca.value=data.mloca; } } } openGET,getmodule.php?q=+str,true; xmlhttp.send; } Kinder应用程序 编辑 拖放以上载 警告:上载具有相同文件名的文件将覆盖上载的文件。 模块ID: ;
经过三天的故障排除,我找到了自己问题的解决方案

以下是正确的代码:

Edit.php:

Kinder应用程序-编辑 正文{背景图像:url/KinderApp/images/Untitled-1.png;背景重复:无重复;}] 标题{颜色:黑色;背景颜色:白色;} 页脚{颜色:绿色;背景颜色:浅灰色;} h1{字体系列:连环画,连环画MS,草书;字体大小:50px;} h6{字体系列:连环画,连环画MS,草书;字体大小:15px;颜色:红色;字体大小:粗体;} span{字体系列:连环画,连环画MS,草书;字体大小:15px;颜色:蓝色;} 功能显示{ var refresh=1000;//刷新率(毫秒) mytime=setTimeout'display\u ct',刷新 } 功能显示{ var strcount var x=新日期 document.getElementById'ct'.innerHTML=x; tt=显示器; } 函数showModulestr { 如果str== { document.getElementById.value=; 回来 } if window.XMLHttpRequest {//IE7+、Firefox、Chrome、Opera、Safari的代码 xmlhttp=新的XMLHttpRequest; } 其他的 {//IE6、IE5的代码 xmlhttp=新的ActiveXObjectMicrosoft.xmlhttp; } xmlhttp.onreadystatechange=函数 { 如果xmlhttp.readyState==4&&xmlhttp.status==200 { var data=JSON.parsexmlhttp.responseText; {
forvar i=0;如果可能,请发布您从ajax请求中收到的json数据,并使用firebug检查您的控制台,以检查在解析时是否出现任何js错误。您发布的是控制台错误是的,这很有帮助,但Atul要求的是网络监视器中的请求/响应。