Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.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调用Php Web服务_Javascript_Html_Web Services - Fatal编程技术网

从javascript调用Php Web服务

从javascript调用Php Web服务,javascript,html,web-services,Javascript,Html,Web Services,我试图调用一个web服务,该服务具有来自JavaScript的Json输出。但是我无法得到这个值。我尝试了不同的方法,但都没有成功。请帮忙 这是我试过的代码 <script src="jquery-1.3.2.min.js"></script> <script type="text/javascript"> function callajax(){ var html =$.ajax({ cache: false,

我试图调用一个web服务,该服务具有来自JavaScript的Json输出。但是我无法得到这个值。我尝试了不同的方法,但都没有成功。请帮忙

这是我试过的代码

  <script src="jquery-1.3.2.min.js"></script>
  <script type="text/javascript">

     function callajax(){ 
    var html =$.ajax({
       cache: false,
       type: "GET",
       async: false,`enter code here`
       data: {},
       url: "http://domain/abc.php?param=abcd',
       contentType: "application/json; charset=utf-8",
       dataType: "json",
       crossDomain: true,
       Success: SucceedFunc,`enter code here`
       error: function (request, errorText, errorCode) 
       {
         alert(errorText+"--"+errorCode);
       }
     });      
   }   
   function SucceedFunc(data, status) 
   {
    alert("Enter into Success");
    alert(data);
   }

函数callajax(){
var html=$.ajax({
cache:false,
键入:“获取”,
async:false,`在此处输入代码`
数据:{},
url:“http://domain/abc.php?param=abcd',
contentType:“应用程序/json;字符集=utf-8”,
数据类型:“json”,
跨域:是的,
Success:SucceedFunc,`在此处输入代码`
错误:函数(请求、错误文本、错误代码)
{
警报(errorText+“--”+错误代码);
}
});      
}   
函数SucceedFunc(数据、状态)
{
警惕(“进入成功”);
警报(数据);
}

所需的输出为{“name”:Alex,“Success”:true}格式。 我需要为“name”选择值


非常感谢您的帮助。

是因为您的
成功:
是大写的吗?应该是
成功:

编辑:


还有,您使用如此旧版本的jQuery有什么原因吗?它们现在是1.9.x(对于大多数应用而言)。我刚查过,跨域选项添加到了1.5中。

感谢您的快速回复,Ryan,我现在尝试了,尽管我面临着同样的问题。我希望我走的是正确的道路。