简体   繁体   English

var查询未返回所需结果

[英]var query not returning required results

I have a javascript file which is returning results to a HTML page via information entered in a SharePoint list. 我有一个JavaScript文件,该文件通过在SharePoint列表中输入的信息将结果返回到HTML页面。 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. 但是,它没有显示在HTML页面上。 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. 我已经检查了控制台,并返回了在“更多详细信息”字段中输入的信息,但该信息没有显示在HTML页面上。 The rest (Current Status, Typical Usage etc) are showing fine. 其余(当前状态,典型用法等)显示正常。

The Do I need to add something to the var query URL? 我需要在var查询网址中添加一些内容吗? I've post the JavaScript and relevant HTML below: 我在下面发布了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> 

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. 您没有正确打开和关闭“表行” <tr>和“表数据” <td>标签。 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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Mongoose Query Builder .or 不返回预期结果 - Mongoose Query Builder .or not returning expected results MySQL查询未在setInterval上返回最新结果 - MySQL Query not returning newest results on setInterval 从 Firebase 查询返回结果数组 - Returning array of results from Firebase query 返回mysql查询的结果。 最终返回未定义 - Returning the results of an mysql-query. Ends up returning undefined JavaScript查询未从查询返回结果到SharePoint列表 - Javascript query not returning results from query to SharePoint list function(a){var a ='test'; }:需要“var”吗?如果a未定义怎么办? - function(a){ var a='test'; } : Is “var” required? What if a is undefined? JavaScript在for循环中返回var - JavaScript returning var in for loop Google的AutocompleteService和Autocomplete会使用相同的查询返回不同的结果 - Google's AutocompleteService and Autocomplete returning different results with same query 从CFC返回结果之前,对AJAX查询执行字符串函数 - Perform string functions on an AJAX query before returning the results from the CFC 从 mysql 查询返回“结果”参数时未定义 - Undefined when returning 'results' parameter from mysql query
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM