2015-01-24 2 views
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 값이 변경되지 않는다는 것입니다. 왜? 도와주세요, 제발.

+0

settimana과 인덱스 모두 동일한 스크립트 파일을 사용하지만 그들은 같은 일을 공유하는 것을 의미하지 않는다. 둘 다 메모리에 사본이 있으므로 하나의 변경 사항은 다른 사본에는 영향을 미치지 않습니다. 로드하기 전에 필요한 데이터를 전달해야합니다. – Slime

+0

어떻게하면됩니까? – iurimaru

답변

0

서버로 데이터를 보낼 스크립트를 말해야합니다. 그래서 당신은 IMO 당신이 (PHP)에 "$ _POST"전역을 통해 포뮬러 데이터를 소비하는 서버 스크립트가 필요

<from method="POST" action="target.php">......</form> 

뭔가를해야합니다. 나는 순수한 html로, 당신은 단지 폼 데이터로 이메일을 보낼 수 있다고 생각한다.

http://php.net/manual/de/reserved.variables.post.php

관련 문제