productlist_body.jsp

来自「工厂版本管理系统,STRUTS2框架,用于管理商品的版本,便于有效的控制版本」· JSP 代码 · 共 836 行 · 第 1/2 页

JSP
836
字号
	if(quantity == "") { 		return;	}		    var url="/web/search/searchBrowseAction.html?method=checkStockAvailability&stockNumber="+stockNumber+"&quantity="+quantity;      //Do the Ajax call    if (window.XMLHttpRequest){ // Non-IE browsers      req = new XMLHttpRequest();      //A call-back function is define so the browser knows which function to call after the server gives a reponse back      req.onreadystatechange = MshowAvailability;      try {      	req.open("GET", url, true); //was get      } catch (e) {         alert("Cannot connect to server");      }      req.send(null);    } else if (window.ActiveXObject) { // IE            req = new ActiveXObject("Microsoft.XMLHTTP");      if (req) {        req.onreadystatechange = MshowAvailability;        req.open("GET", url, true);        req.send();      }    }  }      //Callback function   function MshowAvailability(){   	var MdivId = 'MstockAvailabilityMsg'+stockNumber;	var MdivId2 = 'MtfgAtp'+stockNumber;	var MdivId3 = 'Mcheck'+stockNumber;	var MdivId4 = 'MstockY'+stockNumber;	var MdivId5 = 'Mreferral'+stockNumber;	if (req.readyState == 4)	{ // Complete	var quantity =  document.getElementById('Mform2'+stockNumber).qty.value;	var ssm =  document.getElementById('Mform'+stockNumber).qty.value;	document.getElementById('Mform'+stockNumber).qty.value = quantity;	//alert(ssm)	var msg = req.responseText;	availabilityLabelAndIndicator  = msg.split("||");	var availabilityLabelvalue = availabilityLabelAndIndicator[0];	var availabilityIndicator = availabilityLabelAndIndicator[1]; 						document.getElementById(MdivId).style.display="none";	document.getElementById(MdivId2).style.display="block";		if (availabilityIndicator=='Y'){		if (quantity==ssm){		document.getElementById(MdivId4).innerHTML=availabilityLabelvalue;		}		else{		document.getElementById(MdivId4).innerHTML=quantity + "&nbsp;" + availabilityLabelvalue;		}	document.getElementById(MdivId2).style.display="block";	}		else if (availabilityIndicator=='P'){	document.getElementById(MdivId4).innerHTML=availabilityLabelvalue;	/* Removed re bug R84-1616	document.getElementById(divId2).style.display="none";	*/	}		else	{	document.getElementById(MdivId4).innerHTML=availabilityLabelvalue;	document.getElementById(MdivId4).style.color="black";	document.getElementById(MdivId4).style.fontWeight="normal";	document.getElementById(MdivId2).style.display="none";	document.getElementById(MdivId5).style.display="block";	}	}}function McheckCount(formName,e) {	var stockCount = document.getElementById(formName).qty.value;	var key = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;	// Get ASCII value of key that user pressed	if (navigator.appVersion.indexOf("MSIE")!=-1){//For IE Browser{		if(key==13){			McheckAvailability(formName);			return false;		}else if ((key > 47 && key < 58 || key==8 || key ==46 || key==37 || key ==39 || key > 95 && key < 106)){		}else{			window.event.returnValue = null;		}	}else{			if(key==13){			McheckAvailability(formName);			return false;		}else if ((key > 47 && key < 58 || key==8 || key ==46 || key==37 || key ==39 || key > 95 && key < 106)){		}else{			e.preventDefault();			e.returnValue = null;		}	}}</script>	<c:forEach items="${products}" var="product" varStatus="status">	<tr style="background-color: rgb(255, 255, 255);" class="prodRow" onmouseover="this.style.backgroundColor='#f0f0f0'" onmouseout="this.style.backgroundColor='#FFFFFF'">	   <td class="lineRow" align="center" valign="top">	   	<a href="product-detail.action?product.id=${product.id }" title="${product.shortDetail }">				<img src="../image/noImage.gif" alt="${product.shortDetail }" border="0">				<p>${product.id }</p>		</a>		</td>		<td class="lineRow" valign="top">				<a href="product-detail.action?product.id=${product.id }" title="${product.shortDetail }">${product.shortDetail }</a>		<!-- Production Packs -->				</td>			<td class="lineRow" align="center" valign="top">				<form name="searchBrowseForm" id="form0376243" method="post" action="product-list.addToShoppingCart.action?categoryItemId=${categoryItemId }">			<div>				<input name="org.apache.struts.taglib.html.TOKEN" value="fe680bc49ebd53f9a0e7a9aa5a188c83" type="hidden">			</div> 			<input size="4" id="qty" name="quantity" value="1" type="text">						<input name="productId" type="hidden" value="${product.id }">												<br>			<input style="padding-top: 5px;" src="../image/site/search/add.gif" title="加入您的订购单" type="image">		</form>						</td>		<td class="lineRow" align="center" valign="top">		<div class="uom">1</div>								<table class="priceList" cellpadding="0" cellspacing="0">				 				<tbody><tr><td class="plColumn">1+</td><td class="plPrice"> RMB${ product.price } </td></tr>								<c:forEach items="${product.discountPolicies}" var="item">					<tr><td class="plColumn">${item.key}+</td><td class="plPrice"> RMB${item.value} </td></tr>				</c:forEach>							</tbody></table>										</td>		<td class="lineRow" valign="top">								<div class="stockY" id="stockY0376243" style="display: block;">			现货库存						</div>			<!-- LIVE STOCK CHECK -->			<span id="stockAvailabilityMsg0376243"><a href="javascript:checkAvailability('form20376243')">查看实时库存</a></span>			<div id="tfgAtp0376243" class="tfgAtpOff" style="display: none;">			<div style="display: block;" id="check0376243">						<form id="form20376243" name="form20376243" action="/web/cart/shoppingCart.html?method=updateShoppingCart" method="post"> 				<input size="4" id="qty" maxlength="7" name="qty" onkeydown="return checkCount('form20376243',event);return false;" value="1" type="text">			<input size="3" id="stocknum" name="stocknum" value="0376243" type="hidden">			</form>			<a href="javascript:void(0);" onclick="checkAvailability('form20376243')">查看不同数量</a>							</div>			</div>			<!-- END LIVE STOCK CHECK -->			<!-- Alternative -->			<span id="referral0376243" style="display: none;"></span>						<!-- End Alternative -->				</td>		<td class="lineRow" align="left" valign="top">		<form name="tfg">			<div id="datasheet">			&nbsp;		<div class="datasheetclassdiv" id="datasheetdiv0376243">			<span class="datasheetborder">			<span class="closebtn">技术数据数据表<a href="javascript:closedatasheet(0376243);" title="退出"><img src="product-list_files/remove.gif" alt="退出" style="float: right; position: absolute; right: 5px; top: 5px;" border="0"></a></span><iframe src="product-list_files/searchBrowseAction_025.html" name="datasheetwindow" class="datasheetclass" id="datasheet0376243" frameborder="0"></iframe></span>		</div>		</div>		</form>		</td>		<td class="lineRow" align="left" valign="top">			&nbsp;		</td>		<td class="lineRow" valign="top">&nbsp;${product.manufactory.name }</td>		<td class="lineRow" valign="top">&nbsp;</td>		    	</tr>			</c:forEach>	  </tbody></table>  </div>  </div>  <!-- Paging --><div>	<div class="viewing">观看第	<span>1&nbsp;-&nbsp;	25		</span> 	项/&nbsp;<span>279</span>&nbsp;项搜寻结果	</div>	<div id="pageAvail">																<span class="on">1</span>																																									|					<a href="http://shanghai.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&amp;Nr=AND%28avl%3acn03%2csearchDiscon_cn03%3aN%29&amp;N=4294900061+4294895025&amp;binCount=279&amp;No=25"><span>2</span></a>																																				|					<a href="http://shanghai.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&amp;Nr=AND%28avl%3acn03%2csearchDiscon_cn03%3aN%29&amp;N=4294900061+4294895025&amp;binCount=279&amp;No=50"><span>3</span></a>																																				|					<a href="http://shanghai.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&amp;Nr=AND%28avl%3acn03%2csearchDiscon_cn03%3aN%29&amp;N=4294900061+4294895025&amp;binCount=279&amp;No=75"><span>4</span></a>																																				|					<a href="http://shanghai.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&amp;Nr=AND%28avl%3acn03%2csearchDiscon_cn03%3aN%29&amp;N=4294900061+4294895025&amp;binCount=279&amp;No=100"><span>5</span></a>																																				|					<a href="http://shanghai.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&amp;Nr=AND%28avl%3acn03%2csearchDiscon_cn03%3aN%29&amp;N=4294900061+4294895025&amp;binCount=279&amp;No=125"><span>6</span></a>																																				|					<a href="http://shanghai.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&amp;Nr=AND%28avl%3acn03%2csearchDiscon_cn03%3aN%29&amp;N=4294900061+4294895025&amp;binCount=279&amp;No=150"><span>7</span></a>																																				|					<a href="http://shanghai.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&amp;Nr=AND%28avl%3acn03%2csearchDiscon_cn03%3aN%29&amp;N=4294900061+4294895025&amp;binCount=279&amp;No=175"><span>8</span></a>																																				|					<a href="http://shanghai.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&amp;Nr=AND%28avl%3acn03%2csearchDiscon_cn03%3aN%29&amp;N=4294900061+4294895025&amp;binCount=279&amp;No=200"><span>9</span></a>																		&nbsp;&nbsp;<a href="http://shanghai.rs-online.com/web/search/searchBrowseAction.html?method=retrieveTfg&amp;Nr=AND%28avl%3acn03%2csearchDiscon_cn03%3aN%29&amp;N=4294900061+4294895025&amp;binCount=279&amp;No=25">下一页</a>			</div></div> </div><br><br><script language="javascript1.2" type="text/javascript"> var stockNumber; /*  * Get the second options by calling a Struts action */ function checkAvailability(formId){ 	var formName = formId;	stockNumber =  document.getElementById(formName).stocknum.value;	var quantity =  document.getElementById(formName).qty.value;	//alert(quantity);	if(quantity == "") { 		return;	}		    var url="/web/search/searchBrowseAction.html?method=checkStockAvailability&stockNumber="+stockNumber+"&quantity="+quantity;      //Do the Ajax call    if (window.XMLHttpRequest){ // Non-IE browsers      req = new XMLHttpRequest();      //A call-back function is define so the browser knows which function to call after the server gives a reponse back      req.onreadystatechange = showAvailability;      try {      	req.open("GET", url, true); //was get      } catch (e) {         alert("Cannot connect to server");      }      req.send(null);    } else if (window.ActiveXObject) { // IE            req = new ActiveXObject("Microsoft.XMLHTTP");      if (req) {        req.onreadystatechange = showAvailability;        req.open("GET", url, true);        req.send();      }    }  }      //Callback function   function showAvailability(){   	var divId = 'stockAvailabilityMsg'+stockNumber;	var divId2 = 'tfgAtp'+stockNumber;	var divId3 = 'check'+stockNumber;	var divId4 = 'stockY'+stockNumber;	var divId5 = 'referral'+stockNumber;	if (req.readyState == 4)	{ // Complete	var quantity =  document.getElementById('form2'+stockNumber).qty.value;	var ssm =  document.getElementById('form'+stockNumber).qty.value;	document.getElementById('form'+stockNumber).qty.value = quantity;	//alert(ssm)	var msg = req.responseText;	availabilityLabelAndIndicator  = msg.split("||");	var availabilityLabelvalue = availabilityLabelAndIndicator[0];	var availabilityIndicator = availabilityLabelAndIndicator[1]; 						document.getElementById(divId).style.display="none";	document.getElementById(divId2).style.display="block";		if (availabilityIndicator=='Y'){		if (quantity==ssm){		document.getElementById(divId4).innerHTML=availabilityLabelvalue;		}		else{		document.getElementById(divId4).innerHTML=quantity + "&nbsp;" + availabilityLabelvalue;		}	document.getElementById(divId2).style.display="block";	}		else if (availabilityIndicator=='P'){	document.getElementById(divId4).innerHTML=availabilityLabelvalue;	/* Removed re bug R84-1616	document.getElementById(divId2).style.display="none";	*/	}		else	{	document.getElementById(divId4).innerHTML=availabilityLabelvalue;	document.getElementById(divId4).style.color="black";	document.getElementById(divId4).style.fontWeight="normal";	document.getElementById(divId2).style.display="none";	document.getElementById(divId5).style.display="block";	}	}}function checkCount(formName,e) {	var stockCount = document.getElementById(formName).qty.value;	var key = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;	// Get ASCII value of key that user pressed	if (navigator.appVersion.indexOf("MSIE")!=-1){//For IE Browser{		if(key==13){			checkAvailability(formName);			return false;		}else if ((key > 47 && key < 58 || key==8 || key ==46 || key==37 || key ==39 || key > 95 && key < 106)){		}else{			window.event.returnValue = null;		}	}else{			if(key==13){			checkAvailability(formName);			return false;		}else if ((key > 47 && key < 58 || key==8 || key ==46 || key==37 || key ==39 || key > 95 && key < 106)){		}else{			e.preventDefault();			e.returnValue = null;		}	}}function encodeURI(tfgQueryString,attributeName, nso) {	var link1 = "/web/search/searchBrowseAction.html?method=retrieveTfg&"+tfgQueryString+"&Ns="+encodeURIComponent(attributeName)+"&Nso="+nso+"#resultArrow";	window.location = link1;	return true;}</script>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?