1
我有一个html5页面,我在某些javascript中存储了一个变量。我将一个名为“namer”的变量从ul中存储。在html5中获得javascript变量
<script>
$(document).ready(function() {
$("a").click(function(event) {
sessionStorage.setItem("namer", $(this).text());
window.location="Antibiotics2.php";
});
event.preventDefault();
});
</script>
现在,当新的窗口打开我要访问“命名器”从HTML5代码,这样我可以命名检索值后的标题。我想在下面的代码中写下“namer”的值。
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div data-role="page" class="div1">
<div data-role="header">
<h1>"namer"</h1>
</div>
<div data-role="content">
</div>
</div>
</body>
</html>
我可以从JavaScript与键访问它没有问题,但无法弄清楚如何从HTML得到它。