【日常學習筆記】2019/1/(4,7)(SSM再熟悉與網頁傳值)

學生管理系統(SSM簡易版)總結

可以用來再次熟悉SSM

https://www.jianshu.com/p/6a594fbea51d


頁面傳值

示例:點擊a頁面的p標籤,將p標籤內的學號傳遞到b頁面,之後b頁面根據得到的值,再進行ajax數據請求,顯示此學號的詳情。

a頁面

<html>
	<title>測試</title>
	<style>
		p {text-decoration:none;}
		p:hover{text-decoration:underline;}
	</style>
	<body>
		<p onclick="window.open('b.html?st_id='+this.innerHTML,'_blank')" style="cursor:pointer" title="查看詳情">15200141115</p>
	</body>
</html>

b頁面

<html>
	<body>
		<script type="text/javascript">
			onload=function(){
					var st_id=window.location.href.split("=")[1];
					alert(st_id);
					}
		</script>
	</body>
</html>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章