0

So I have a local site that runs and posts forms to my web server, however I want a feedback on the form that tells the person using the form something.

For Example if someone signed in and then as they were signing out it would tell them what time they signed in:

 <form action="http://www.example.com/signout.php" method="post" name="signoutForm">
      <input type="text" name="firstname" id="ofname" autocomplete="off" required><br>
      <div id="feedback"></div>
      <input type="submit">
 </form>

 <script>
      $('#ofname').keyup(function() {
           //ofname is the two id for the check signout; o for out
           $.post('http://www.example.com/checksignout.php', { 
                firstname: document.signoutForm.firstname.value
           },
           function(result) {
                $("#feedback").html(result);
           }
      });
 </scipt>

But I guess jquery can't do like cross domain requests? Is there a way around this?

user2701687
  • 327
  • 1
  • 5
  • 13
  • 1
    This isn't because of jQuery, this is because of the Same Origin Policy. https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy – David Jul 30 '14 at 18:50
  • jQuery is perfectly happy making cross origin requests, subject to the normal limitations imposed on them by browsers. – Quentin Jul 30 '14 at 18:50

0 Answers0