Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery show neither html not working with $.ajax?
    text
    copied!<pre><code>&lt;form method="post" action="#" name="sign-up" id="sign-up"&gt; &lt;label for="name"&gt;Name:&lt;/label&gt; &lt;input type="text" id="name" name="name"&gt; &lt;label for="last-name"&gt;Last Name:&lt;/label&gt; &lt;input type="text" id="last-name" name="last-name"&gt; &lt;label for="age"&gt;Age:&lt;/label&gt; &lt;input type="text" id="age" name="age"&gt; &lt;label for="email"&gt;Email:&lt;/label&gt; &lt;input type="email" id="email" name="email"&gt; &lt;input type="submit" value="Verify" id="submit-form"&gt; &lt;/form&gt; &lt;div id="result"&gt;&lt;/div&gt; &lt;script&gt; (function() { $('form').on('submit',function(e) { e.preventDefault(); $('#verify').slideUp(); $.ajax({ type: "POST", url:"https://externalhost/file.php",//not the actual host data: $('form').serialize(), success: function(result) { $('#result').html(result); } }); }); })(); </code></pre> <p>As you can see, I'm trying to make a subscription form for my visitors but I'm having trouble with it.</p> <p>First of all, I can't check if all fields have been completed because it's showing the result, for example with .show().</p> <p>Second, the $.ajax form it self it's working, I'm receiving all the info and everything it's being registered in MySql so the external file called via $.ajax it's fine also, but the result it's not being shown.</p> <p>Also, this is going to be a Facebook App but it's not working out of Facebook either :/</p> <p>Can anyone please help me, what I'm doing wrong here?</p> <p>Edit:</p> <p>Though the # in the markup was a mistake, I fixed it but again it's not working :/</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload