本帖最后由 u013168019 于 2014-12-24 15:32:35 编辑

解决方案 »

  1.   

    后台代码呢?只要后台有这个条形码。你用jq post 传递这个条形码后台查询,然后在返回来。
      

  2.   

    $.ajax({              
                type: "post", //要用post方式                 
                url: "XFS_ProductList.aspx/GetInfo",//方法所在页面和方法名
       data: "{'action':'autocomplete','search': $("#PrBarcode").val()}",     
                contentType: "application/json; charset=utf-8",     
                dataType: "json",     
                success: function(data) {                    
                    alert(data.d);//返回的数据用data.d获取内容
                },
                error: function(err) {     
                    alert(err);     
                }     
            });
    [WebMethod]
    public static string GetInfo(string barcode)
    {
    //查询数据库 //select  * from info where barcode='"+barcode+"';
    //组成 字符串或者json 格式返回去到JS
        return "xxx";
    }