I have three very simple files:
test_parent.html,
test_child.html, and
simple_script.php.
All three are located on the same domain, in the same directory.

test_child.html simply displays a button, that, when pressed, makes an asychronous request to simple_script. When the request successfully comes back, test_child.html throws up an alert message. This works with no problems.

test_parent.html also simply displays a button. However, this button triggers window.open(), which opens test_child.html. test_child.html successfully opens and displays its button, but its button no longer works. Now I get the error message: "uncaught exception: Permission denied to call method XMLHttpRequest.open".

This happens on the Mac version of Firefox. It does NOT happen on Safari. I don't know if it happens on the Windows version of Firefox.

I've seen online explanations that this error occurs when a page tries to asynchronously access a script on another domain. Here, however, not only is everything on the same domain, it's in the same directory!

Can anybody help? Specifically, can anybody
1) also confirm that this happens to them
2) explain WHY this is happening, and, most important,
3) suggest a fix of some kind?

OH I'd be so grateful if somebody could help me. Here are the files:


+++ simple_script.php++++++++++++++++
<?
echo $_POST['data'];
?>
+++++++++++++++++++++++++++




++++ test_child.html ++++++++
<html>
<head>

<script>
request = new XMLHttpRequest();
function postData() {
var url = "simple_script.php";
request.open("POST", url, true);
request.onreadystatechange = showAlert;
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
request.send('data=This is a test');
}

function showAlert() {
if (request.readyState == 4) {
if (request.status == 200) {
alert(request.responseText);

}
}
}
</script>
</head>

<body>
<button id="saveButton" type="button" onclick="postData()">Post</button>
</body>
</html>
++++++++++++++++++++++++++++




+++++++ test_parent.html +++++++++++
<html>
<head>
</head>

<body>
<button type="button" value="Open Window" onclick="window.open('test_child.html')">Open Window</button>
</body>
</html>
++++++++++++++++++++++++++++

Thanks,
Robbie