When the JQuery function tries to open a new page in firefox, the message "firefox prevented this site from opening a pop-up window" is presented. As I understand based on Is window,open() impossible in firefox and Links to local page do not work this is a local problem that only happens because I am trying to access a file in my server from the "localhost". However, when this site will be realy working, other people will not have the same problem just because they are not accessing their own server. Does this interpretation make sense? Or I am wrong and I have to deal with this problem? By the way, it is easy to solve locally this problem since I have only change the preferences of firefox. My worries are related with the other people accessing my web site.
For reference, this is my code:
<?php
$theUsernameDaniel = "danielcajueiro";
$theUsernameMarcelo = "marcelopapini";
?>
<html>
<head>
<meta charset="utf-8" />
<title>ControllingHiperlinks</title>
<script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
$("a.peoplePage").click(function(event) {
event.preventDefault();
var theUsername = $(this).data("username");
// alert(theUsername);
// event.preventDefault();
$.post('callmpeoplepage.php', {theUsername: theUsername}, function(data) {
var thePeoplePage = window.open("about:blank");
thePeoplePage.document.write(data);
});
});
});
</script>
</head>
<body>
<a class="peoplePage" data-username="<?php echo $theUsernameDaniel ?>" href=""> Daniel Cajueiro</a>
<a class="peoplePage" data-username="<?php echo $theUsernameMarcelo ?>" href="">Marcelo Cajueiro</a>
</body>
</html>
callmpeoplepage.php is
<?php
$theUsername = $_POST['theUsername'];
echo $theUsername;
?>