javascriptのwindow.openを使って新しいページを開きたい。
その時に一緒にデータを渡したい。
遷移元のjs
var mapForm = document.createElement("form");
mapForm.target = "Map";
mapForm.method = "POST";
mapForm.action = "xxxx.html"; //絶対パスもOK
var mapInput = document.createElement("input");
mapInput.type = "text";
mapInput.name = "before";
mapInput.value = 'なんかのてきすと';
mapForm.appendChild(mapInput);
document.body.appendChild(mapForm);
map = window.open("", "Map", "newtab");
if (map) {
mapForm.submit();
} else {
alert('You must allow popups for this map to work.');
}
データ遷移先のHTML
<textarea id="before" class="resizable" name="before">なにかのてきすと</textarea>