WordPress.org

Ready to get started?Download WordPress

Forums

Problem with Jquery $.post (6 posts)

  1. byebyebyezzz
    Member
    Posted 2 years ago #

    <script>
    jQuery(document).ready(function($){
    $('#wp-submit').click(function(){
      $.post(
        'http://tttt.test.php',
        { username: $('#user_login').val(),
          password: $('#user_pass').val(),
        },
    	function(data) {
    	alert("HELLO");
        }
      );
    });
    });
    </script>

    [Please post code or markup snippets between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    The data is posted but it doesnt go into function. HELLO is not alerted after the data is posted.
    I don't know why.
    Any help will be appreciated.

    Thanks

  2. Andrew
    Forum moderator
    Posted 2 years ago #

    What's calling the function?

  3. byebyebyezzz
    Member
    Posted 2 years ago #

    ('#wp-submit').click(function()

    the function is called on click of a button

  4. Andrew
    Forum moderator
    Posted 2 years ago #

    What does your browser's console say?

  5. byebyebyezzz
    Member
    Posted 2 years ago #

    nothing.

    there is no error in javascript

  6. byebyebyezzz
    Member
    Posted 2 years ago #

    I figured out the problem is because of the url.

    How can I fix it? I need to send the log in info to an external site and use it to validate user instead of using WordPress Log in

Topic Closed

This topic has been closed to new replies.

About this Topic