扫描条形码,获取数据库数据。 然后调用数据库数据 本帖最后由 u013168019 于 2014-12-24 15:32:35 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 后台代码呢?只要后台有这个条形码。你用jq post 传递这个条形码后台查询,然后在返回来。 $.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";} JS在新窗口中打开链接 js如何获得flash中的url(急用!在线等待。。。。) 服务器上有的网页有这段代码,请大家帮忙看看这段代码的结果是什么?会对服务器造成什么影响? 正则表达式 怎样从一个table里的控件找到这个table里的另一个控件。 js获得get值问题 请问怎么通过javascript清空ie缓存 虚心请教 如何用javascript向页面添加一个radio控件? 请问:判断一系列radios里有没有被选中的项或被项中了哪一项的函数 jquery取不到hiddenfield的值 静态html在vs2010中现在不能加ActiveX控件了吗?
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";
}