js + ajax实现商品列表页到详情页的跳转

html部分:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>首页</title>
		<link rel="stylesheet" href="./css/index.css">
	</head>
	<body>
		<div class="box"></div>
		<script src="./js/index.js"></script>
	</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>商品详情</title>
	</head>
	<link rel="stylesheet" href="./css/home.css">
	<body>
		<div class="box">

			<div><strong>积分:20</strong>
				<strong>人气:99</strong>
			</div>

		</div> -->
		</div>
		<script src="./js/home.js"></script>
	</body>
</html>

css部分:

* {
	margin: 0;
	padding: 0;
}

.box {
	width: 50%;
	margin-left: 1%;
	display: flex;
	flex-wrap: wrap;
	margin: 0 auto;
}

.item {
	width: 44%;
	margin: 1% 10px;
}

.item img {
	width: 100%;
	height: 300px;
}

.item p {
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
	line-height: 36px;
}

.item div {
	width: 100%;
	display: flex;
	justify-content: space-between;
}
* {
	margin: 0;
	padding: 0;
}

.box {
	width: 50%;
	margin-left: 1%;
	display: flex;
	flex-wrap: wrap;
	margin: 0 auto;
}

.head {
	width: 100%;
	display: flex;
	align-items: center;
}

.head img {
	width: 20px;
	height: 20px;
}

h1 {
	margin: 0 auto;
}

.item {
	width: 44%;
	margin-top: 5%;
	margin-left: 30%;
}

.item img {
	width: 100%;
	height: 300px;
}

.item p {
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
	line-height: 36px;
}

.item div {
	width: 100%;
	display: flex;
	justify-content: space-between;
}

JavaScript部分:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值