2

我有一个问题,我在一个站点上使用 SPservices,它工作得很好。

但是当我用手机访问该网站时,它不起作用,JQuery 工作,只是 SPservices 不工作。

我相信这是对 SPservices 的一种非常标准的使用

function updateMat(){
  var id = $("input[title='SolcDescItem']").val();
  //alert(id);
  var query = "<Query><Where><Eq><FieldRef Name='CatDescItem'/><Value Type='Text'>" + id + "</Value></Eq></Where></Query>"
  var marca, desc, serie, fam, formato, costoMuestra, candidad, subtotal;

  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "catItems",
    CAMLQuery: query,
    CAMLRowLimit: 1,
    completefunc: function (xData, Status) {
      var hasRows = false;
      $(xData.responseXML).find("z\\:row, row").each(function () {
        hasRows = true; 
        //valores
        serie = $(this).attr("ows_CatSerie");                 
        marca = $(this).attr("ows_CatMarca");
        desc = $(this).attr("ows_CatItem");
        fam = $(this).attr("ows_CatFam");
        formato = $(this).attr("ows_CatFormato");
        costoMuestra = $(this).attr("ows_CatCostoMuestra");    
      });
    }
  }); //spservices
  var cost = parseFloat(costoMuestra);
  cantidad = $("input[title='SolcCantidad']").val();
  subtotal = parseFloat(cantidad*cost);
  var multmult=Math.round(subtotal*100)/100;
  $("input[title='SolcSerie']").val(serie);
  $("input[title='SolcMarca']").val(marca);
  $("input[title='SolcFam']").val(fam);
  $("input[title='SolcFormato']").val(formato);
  $("input[title='SolcCostoMuestra']").val(cost);
  $("input[title='SolcItem']").val(desc);
  $("input[title='SolcSubtotal']").val(multmult);
}

它所做的是检索列表“catItems”中的信息并将其分配给变量,然后我将这些值分配给 SharePoint 表单字段。

我尝试过不同(但不是全部)版本的 SPservices,尽管我认为这不是版本问题。

有什么见解吗?还有其他人有这个问题吗?

提前致谢

4

0 回答 0