手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >javascript+ajax实现产品页面加载信息
javascript+ajax实现产品页面加载信息
摘要:js//加载页面//加载产品列表functionGetProductList(){functionPostParam(param){para...

js

//加载页面 //加载产品列表 function GetProductList() { function PostParam(param) { param.key = "lm324"; return param; } var PostExecParam = { ClassName: "AnxinE.BLL.Product.ProductInfoBLL", MethodName: "Search", ParamModelName: "AnxinE.Model.Product.ProductInfoParam", onRequest: PostParam, onResponse: function (result) { if (result != null) { var html = ""; //汇率判断 //<td>" + (result.SupplierProductList[i].ProductList[j].PriceUSD.toString() == '0' ? 1 : result.SupplierProductList[i].ProductList[j].USDPriceList[0].MinQuantity) + ":" + result.SupplierProductList[i].ProductList[j].PriceUSD + "</td> //展示搜索-产品信息列表 for (var i = 0; i < result.SupplierProductList.length; i++) { for (var j = 0; j < result.SupplierProductList[i].ProductList.length; j++) { //if (result.SupplierProductList[i].ProductList[j].PriceUSD!=null) { //} html += "<tr><td>" + result.SupplierProductList[i].ProductList[j].Model + "</td><td>" + result.SupplierProductList[i].ProductList[j].Manufacturer + "</td><td>" + (result.SupplierProductList[i].ProductList[j].Quantity) + "</td><td>" + result.SupplierProductList[i].ProductList[j].ShipDays + "</td><td>" + result.SupplierProductList[i].ProductList[j].MinOrderQuantity + "+</td><td>" + result.SupplierProductList[i].ProductList[i].DeliveryPoint + "</td><td>" + result.SupplierProductList[i].ProductList[j].PriceUSD + "</td><td>" + result.SupplierProductList[i].ProductList[j].PriceCNY + "</td><td><a href=''>加入购物车</td></tr><br/>"; } } //展示搜索--品牌列表 var html2 = "<h2>全部</h2>"; if (result.ManufacturerList.length > 0) { for (var i = 0; i < result.ManufacturerList.length ; i++) { if (result.ManufacturerList[i].KeyName != null) { if (i < 5) { html2 += "<h2 href='javascript:void(0);' id='" + result.ManufacturerList[i].KeyName + "' onclick='Trademark(this)' >" + result.ManufacturerList[i].KeyName + "</h2>"; } } } //<a href="javascript:void(0);" id="regain_r2">收回</a> html2 += "<a href='javascript:void(0);' id='more_r2' onclick='More_r2()'>更多+</a>"; } //不删除第一个内容,将产品信息表追加 $("#r2_text2").not($(".cur1")).empty(); $("#r2_text2").append(html2); //改写品牌行 $(".tr3").empty(); $(".tr3").append(html); } } }; $.ajaxRequest(PostExecParam); };

.cshtml

<div> <div> <ul> <li><img src="~/MvcImages/ycysqd/sx_03.gif" /><p>筛选</p></li> <li><a href="">集成电路</a>>></li> @*<li><a>INFINEON</a><span>×</span></li> <li><a>100-1000件</a><span>×</span></li> <li><a>国内</a><span>×</span></li>*@ </ul> <div><h1>型号:</h1><div><input id="typeofproduct" type="text" value="输入型号" /></div></div> <div><h1>品牌:</h1><div id="r2_text2"><h2>全部</h2><h2>FTDI</h2><h2>WIINET</h2><h2>3M-STATIC CONTROL SOLUTIONS</h2><h2>AAVID THERMALLOY</h2><h2>ALLIANCE</h2><a href="javascript:void(0);" id="more_r2">更多+</a></div><div id="r2_text2_2"></div></div> <div><h1>库存数量:</h1><div><input type="text" id="startnumber" value="1000" /></div><a>-</a><div><input id="endnumber" type="text" value="1000000" /></div><a>件</a></div> <div><h1>交货地:</h1><div><h2>全部</h2><h2>国内</h2><h2>香港</h2></div></div> </div> </div> <table> <tr> <td><p>型号</p></td> <td><p>品牌</p></td> <td><p>库存数量</p></td> <td><p>货期</p></td> <td><p>起订量</p></td> <td><p>交货地</p></td> <td><p>香港交货</p></td> <td><p>国内交货</p></td> <td><p>操作</p></td> </tr> <tr> <td></td> <td></td> <td></td> <td><p>(工作日)</p></td> <td></td> <td></td> <td></td> <td><p>(含17%税)</p></td> <td></td> </tr> <tbody></tbody> </table>

以上所述就是本文的全部内容了,希望大家能够喜欢。

【javascript+ajax实现产品页面加载信息】相关文章:

学习javascript文件加载优化

javascript实时显示当天日期的方法

JavaScript实现添加、查找、删除元素

javascript元素动态创建实现方法

JavaScript实现鼠标拖动效果的方法

利用js实现禁止复制文本信息

javascript 动态添加表格行

javascript实现行拖动的方法

JavaScript实现带标题的图片轮播特效

javascript实现淡蓝色的鼠标拖动选择框实例

精品推荐
分类导航