0
html/css/js로 캘린더를하고 있습니다.다른 페이지의 버튼으로 값 변경
<html>
<head>
<title>App calendario</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="myfunc.js"></script>
</head>
<body>
<form>
<button class="button-customize" onclick="MyFunction(4)" type="button">4 - 10</button>
</form>
</body>
JS는 다음과 같습니다 : 나는이 가진 index.html을이
function MyFunction(x) {
window.open("settimana.html","_self");
document.getElementById("Giorno_1").innerHTML = x;}
다른 페이지, settimana.html은 다음과 같습니다
<html>
<head>
<title>Settimana</title>
<link rel="stylesheet" href="./style.css" type="text/css" />
<script src="myfunc.js"></script>
</head>
<body>
<form action="#">
<button class="button-customize" type="submit" id="Giorno_1" name="Giorno_1">Giorno 1</button>
</form>
</body>
</html>
문제는 settimana.html 페이지의 button 값이 변경되지 않는다는 것입니다. 왜? 도와주세요, 제발.
settimana과 인덱스 모두 동일한 스크립트 파일을 사용하지만 그들은 같은 일을 공유하는 것을 의미하지 않는다. 둘 다 메모리에 사본이 있으므로 하나의 변경 사항은 다른 사본에는 영향을 미치지 않습니다. 로드하기 전에 필요한 데이터를 전달해야합니다. – Slime
어떻게하면됩니까? – iurimaru