2013-07-28 148 views
0

我想调用一个具有JavaScript的Json输出的web服务。但我无法获得价值。我尝试了不同的方法,但没有成功。请帮忙 !!从web服务调用javascript

这里是我试过

<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); 
    } 
代码

所需的输出是{ “名”:亚历克斯, “成功”:真正}格式。 我需要为“名称”选择值。

帮助将不胜感激。

回答

0

是因为你的Success:是大写?应该是success:

编辑:

此外,有没有你使用这样一个旧版本的jQuery的原因是什么?他们现在在1.9.x(对于大多数用途)。我只是查了一下,并在1.5中添加了crossDomain选项。

+0

感谢您的快速回复瑞安 我现在试着用 即使在那时我面临同样的问题。 我希望我遵循正确的方式。 – sattawar