HTML code:
<div class="clearfix" style="color: #555" style="display:block; ">
<input type="text" id="id_site" placeholder="nom-du-site" style="width: 245px; font-size: 16px;">
<div style="float: right; color: black; font-size: 16px; margin-top: 10px; margin-left: -6px">.domain.com</div>
</div>
<br>
<div class="spacing">
<a href="" id="envoyer" class="bouton">Envoyer</a>
Here is the javascript code with Query Ajax call:
$("#envoyer").click(function (e) {
// checks user input:
nom = document.getElementById('id_nom');
email = document.getElementById('id_email');
site = document.getElementById('id_site');
$.ajax({
url: 'http://localhost/website/script.php',
dataType: 'jsonp',
data: {
nom: nom,
email: email,
site: site
},
success: function (json) {
DataSeries = json;
},
error: branchAjaxFailed
});
});
Here is script.php (at the moment):
<?
if (isset($_GET["nom"])) $nom = $_GET["nom"];
if (isset($_GET["email"])) $email = $_GET["email"];
if (isset($_GET["site"])) $site = $_GET["site"];
?>
- Chrome freezes indefinitely. If I add a debug break after this Ajax call, Chrome never gets there in the ‘inspect element’ tool.
- IE gives me a “Stack overflow at line 2” error.
Can anyone see what the problem is ?
After trying several things, I found the “guilty” part: the following html code was causing problem:
Removing the href fixes the problem: