⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 navpage.asp

📁 Windows Web脚本开发指南/(美) Dan Heflin, Todd Ney著 的源码
💻 ASP
字号:
<%@ LANGUAGE=JavaScript %>
<!-- #include file=commonSource.inc -->

<html>
<head>
<title>Product Catalog</title>
<base target="_self">
</head>
<body>
<%
  var menuTransform = Application("menuTransform");
  var catalogMenu = Application("catalogMenu");
  var subCatalogList = Session("subcatalogList");
  var cart = Session("cart");
  buildNavigate();
  buildNextPage(Request.QueryString("catID"));

function buildNextPage(catID){
  //Called from the click of a cateogry. Checks to see if a nav page or a catalog should be
  //displayed. Displays the navigational area

  var menuItem = catalogMenu.selectSingleNode("//category[@catID='" + catID + "']");
  var subElement = menuItem.selectSingleNode("categories");
  
  displayHeader(catID);

  if (subElement != null)
    buildNavPage(menuItem);
  else
    buildListPage(menuItem, catID);    
}

function buildListPage(transformStart, catID){
    // Used to display a subcatalog section
    
    var xslNode = menuTransform.selectSingleNode("//xsl:template[@match='itemList']");
    var listLocation = transformStart.getAttribute("source");
    var result = "<form method='post' action='addToCart.asp?catID=" + catID + "&fromList=true'>";
    var transformList;

    subCatalogList.async = false;
    subCatalogList.load(Server.MapPath(listLocation));
    transformList = subCatalogList.selectSingleNode("//itemList");
    result += transformList.transformNode(xslNode);
    result += "<input type='submit' value='Add To Cart'></form>";
    Response.Write(result);
}
%>
</body>
</html>

⌨️ 快捷键说明

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