Hi Sup3rkirby,
Thank you very much for your help. I really appreciate it.
Also, I tried postMessage to pass data between parent window to child window but it doesn't work. The code snippet are as following. In order to simplify the test, I don't use google map on these small programs.
Parent Window:
<html>
<head>
<script type="text/javascript">
function initialize() {
var html = "<table>" +
"<tr><td>Name:</td><td><input type='text' id='name' value=name></td></tr>" +
"<tr><td></td><td><input type='button' value=Save' onclick='SaveData()'/></td></tr>";
document.getElementById("addtable").innerHTML = html;
}
function SaveData() {
var w = window.open("test_child.html");
w.postMessage("test", "http://localhost/test_child.html");
}
</script>
</head>
<body onload="initialize()">
<div>id="addtable"></div>
</body>
</html>
The child window :
<html>
<head>
<script type="text/javascript">
window.addEventListener("message", receiveMessage, false);
function receiveMessage(event) {
alert("ok?");
var v = event.data;
}
</script>
</head>
<body>
</body>
</html>
When I click the Save button in the table of parent window, the child window is opened. But the data is not delivered. The alert("ok?") does not appear.So it looks like the message in parent window doesn't send to child window. I use the firefox. I will use debugger console you mentioned and try to find the bugs. Thanks again!