Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.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 错误:";无法获取属性';内容';未定义或空引用文件的名称_Javascript_Jquery_Cordova_Windows Phone 8 - Fatal编程技术网

Javascript 错误:";无法获取属性';内容';未定义或空引用文件的名称

Javascript 错误:";无法获取属性';内容';未定义或空引用文件的名称,javascript,jquery,cordova,windows-phone-8,Javascript,Jquery,Cordova,Windows Phone 8,我正在尝试使用sharepoint web服务、phoneGap和windows phone 8获取数据。 当我测试下面的代码时,会出现以下错误: 错误:“无法获取未定义或空引用文件的属性“内容”:x-wmapp0:www/webs.html行:1” 需要帮忙吗 <!DOCTYPE html> <html> <head> <title></title> <script src="http://ajax.aspnetcdn.com/

我正在尝试使用sharepoint web服务、phoneGap和windows phone 8获取数据。 当我测试下面的代码时,会出现以下错误:

错误:“无法获取未定义或空引用文件的属性“内容”:x-wmapp0:www/webs.html行:1”

需要帮忙吗

<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js" type="text/javascript"></script>
<script src="cordova-2.3.0.js" type="text/javascript"></script>
</head>
<body>
<div>
<script type="text/javascript">

    $(document).ready(function () {
        var soapEnv =
        "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<listName>Comptes</listName> \
<viewFields> \
<ViewFields> \
<FieldRef Name='WorkAddress' /> \
</ViewFields> \
</viewFields> \
</GetListItems> \
</soapenv:Body> \
</soapenv:Envelope>";

        // Call web service
        $.ajax({
            url: "http://demo-crm.progedsolutions.com/sites/CRM/_vti_bin/lists.asmx",
            type: "POST",
            dataType: "xml",
            data: soapEnv,

            complete: processListAccessResult,
            contentType: "text/xml; charset=\"utf-8\"",
            success: function () {
                alert("success");
            },
            error: function () {
                alert("ERROR");
            },
        });
    });

    // Process result
    function processListAccessResult(xData, status) {
        $(xData.responseXML).find("z\\:row").each(function () {
            $("#data").append("<li>" + $(this).attr("ows_WorkAddress") + "</li>");
        });
    }

</script>

<ul id="data"></ul>
</div>

</body>
</html>

$(文档).ready(函数(){
var soapEnv=
" \
\
\
Comptes\
\
\
\
\
\
\
\
";
//调用web服务
$.ajax({
url:“http://demo-crm.progedsolutions.com/sites/CRM/_vti_bin/lists.asmx",
类型:“POST”,
数据类型:“xml”,
数据:soapEnv,
完成:processListAccessResult,
contentType:“text/xml;字符集=\“utf-8\”,
成功:函数(){
警惕(“成功”);
},
错误:函数(){
警报(“错误”);
},
});
});
//过程结果
函数processListAccessResult(扩展数据、状态){
$(扩展数据.responseXML).find(“z\\:行”).each(函数(){
$(“#数据”)。追加(“
  • ”+$(this).attr(“ows#U工作地址”)+“
  • ”); }); }

      这可能是由于包含的脚本中存在版本冲突。确保
      cordova-2.3.0.js
      可以与
      jquery-1.4.4.js
      一起使用

      1-确保DeviceRady事件可用

            document.addEventListener("deviceready", function () {   });
      
      2-忽略第一个错误,应用程序应该运行良好我已经在cordova 2.7和3.0下对此进行了测试


      3-如果您有全局错误处理程序,只需检查是否触发了此错误并忽略它。

      此错误的可能重复并不能真正回答问题。如果您有不同的问题,可以单击以提问。一旦你有足够的时间,你也可以把更多的注意力放在这个问题上。我已经解决了这个问题,并在这里发布了一个解决方案。谢谢