var查询未返回所需结果 [英] var query not returning required results

查看:131
本文介绍了var查询未返回所需结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个javascript文件,该文件通过在SharePoint列表中输入的信息将结果返回到HTML页面.效果很好,但是我被要求返回另一个包含多个文本的字段,称为更多详细信息".但是,它没有显示在HTML页面上.我已经检查过控制台,并且返回了在更多详细信息"字段中输入的信息,但该信息没有显示在HTML页面上.其余(当前状态",典型用法"等)显示正常.

I have a javascript file which is returning results to a HTML page via information entered in a SharePoint list. It works fine, but I've been asked to return another field of multiple text called 'Further Details'. However it's not showing up on the HTML page. I've checked the console and the information being entered in the Further Details field is being returned, it's just not showing on the HTML page. The rest (Current Status, Typical Usage etc) are showing fine.

我需要在var查询URL中添加一些内容吗?我已经在下面发布了JavaScript和相关的HTML:

The Do I need to add something to the var query URL? I've post the JavaScript and relevant HTML below:

function getDeviceKnownIssues() {
  var txtfurtherinfo = "";
  var txtTitleKnown = "<ol>";


  var query = "**http://example.com/sites/it/ITInfrastructure/_vti_bin/listdata.svc//Knownissues?$filter=DeviceID eq " + window.DeviceId + ** "";

  var call = $.ajax({
    url: query,
    type: "GET",
    dataType: "json",
    headers: {
      Accept: "application/json;odata=verbose"
    }
  });
  call.done(function(data, textStatus, jqXHR) {
    console.log(JSON.stringify(data));
    $.each(data.d.results, function(index, item) {

      txtTitleKnown += "<li>" + item.Title + "</li>";
      if (item.Info != undefined) {
        txtfurtherinfo += item.Info + "\r\n";

      }
    });

    txtTitleKnown = txtTitleKnown + "</ol>";
    $('#knowntitle').append(txtTitleKnown);
    $('#furtherinfo').append(txtfurtherinfo);

  });
  call.fail(function(jqXHR, textStatus, errorThrown) {
    alert("Error retrieving data: " + jqXHR.responseText);
  });

}

<tr>
  <td class="tg-yw4l" colspan="3">
    <h2>Known Issues</h2>
    <div id="knowntitle"></div>
    <input type=button onClick="location.href=**'http://example.com/sites/it/ITInfrastructure/_layouts/listform.aspx?PageType=8&ListId={5968ECC4-3049-4794-B6DC-130763C01043}&RootFolder=**'" value='Submit a known issue'>
  </td>
  <td class="tg-yw4l" colspan="3">
    <h2>Accessories</h2>
    <div id="deviceacc"></div>
  </td>
</tr>
<tr>
  <td class="tg-yw4l" colspan="3">
    <h2>Typical Usage</h2>
    <div id="deviceuse"></div>
  </td>
  <td class="tg-yw4l" colspan="3">
    <h2>Current Status</h2>
    <div id="imageContainer"></div>
  </td>
</tr>
<td class="tg-yw4l" colspan="3">
  <h2>Further Information</h2>
  <div id="furtherinfo"></div>
  </table>

推荐答案

似乎您有基本的html语法错误.

我将从那开始.

您没有正确打开和关闭表行" <tr>和表数据" <td>标签.应该是这样的:

You are not opening and closing your 'table row' <tr> and 'table data' <td> tags properly. Should be like this:

[...]
<tr>

    <td class="tg-yw4l" colspan="3">
      <h2>Further Information</h2>
      <div id="furtherinfo"></div>
    </td>

    <td class="tg-yw4l" colspan="3">
    </td>

</tr>
</table>

这篇关于var查询未返回所需结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆