var查询不返回所需的结果

时间:2021-02-01 15:28:45

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.

我有一个javascript文件,它通过在SharePoint列表中输入的信息将结果返回到HTML页面。它工作得很好,但是我被要求返回另一个名为“进一步细节”的多文本字段。但是它不会出现在HTML页面上。我检查了控制台,并返回了输入到详细信息字段中的信息,它只是没有显示在HTML页面上。其余(当前状态、典型用法等)显示良好。

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

我需要向var查询URL添加什么吗?我在下面发布了JavaScript和相关的HTML:

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>

1 个解决方案

#1


0  

It seems that you have basic html syntax error.

看起来您有基本的html语法错误。

I would start from that.

我从这里开始。

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>

#1


0  

It seems that you have basic html syntax error.

看起来您有基本的html语法错误。

I would start from that.

我从这里开始。

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>