总体思路
将参数保存到session中
跳转页面之后,在另一个页面中取出参数。
// 第一个页面
<script type="text/javascript">
<!-- 携带参数跳转页面,将参数进行加密,保存在session中-->
function postToPage(id){
window.localStorage.setItem("communityId",id);
}
</script>
<a href="indexServiceSpace.html" onclick="javascript:postToPage('56')">更多</a>
//第二个页面(indexServiceSpace.html)
<script>
var id = window.localStorage.getItem("communityId");
//这里的id就是第一个页面穿过来的id
</script>
注意:
这里的参数保存到session中,在开发者工具中是可以查到的,为了避免在开发者工具中看到,可以对其进行加密处理。js加密算法