WordPress.org

Ready to get started?Download WordPress

Forums

Problem with Jquery $.post (6 posts)

  1. byebyebyezzz
    Member
    Posted 1 year 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 Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    What's calling the function?

  3. byebyebyezzz
    Member
    Posted 1 year ago #

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

    the function is called on click of a button

  4. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    What does your browser's console say?

  5. byebyebyezzz
    Member
    Posted 1 year ago #

    nothing.

    there is no error in javascript

  6. byebyebyezzz
    Member
    Posted 1 year 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