Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
Obteniendo el error [objeto Objeto] en Javascript y no puedo identificar el problema

Tengo una función a continuación que, cuando se usa en una página web, provoca el error [objeto Objeto] y esperaba que alguien pudiera identificar el problema por mí. Estoy usando este código para obtener el recuento de elementos en vistas particulares de SharePoint para poder mostrarlos en un tablero para los usuarios. Cualquier sugerencia apreciada.

 function countViewItems(listTitle, viewName, elementClass) { // Counts the number of items of in the view 'viewName' of the list 'listTitle'. //get view query of the list view $.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('"+listTitle+"')/views/getbytitle('"+viewName+"')/ViewQuery", type: "GET", headers: { "ACCEPT": "application/json;odata=verbose", }, success: function (data) { var viewQuery=data.d.ViewQuery; //get item count of view var viewXml = '<View><Query>' + viewQuery + '</Query></View>'; var queryPayload = { 'query' : { '__metadata': { 'type': 'SP.CamlQuery' }, 'ViewXml' : viewXml } }; $.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + listTitle + "')/getitems", type: "POST", data: JSON.stringify(queryPayload), headers: { "Accept": "application/json;odata=verbose", "X-RequestDigest": $("#__REQUESTDIGEST").val(), "Content-Type": "application/json; odata=verbose" }, success: function (data) { var itemCount=data.d.results.length; $(elementClass).html(itemCount); }, error: function (data) { alert(JSON.stringify(data)); } }); }, error: function (err) { alert(err); } });

}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!