Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to pass JSON in AJAX

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 104
    Comment on it

    Hello Everyone, today I will guide you "To pass JSON in AJAX ".

    In the below code information is a variable that store JSON. We can pass this variable into AJAX data and get user records, and show it into a userDetail <div>. You can use the below code for the same.

    <script>
    
    var information = ['hi','hello'];
    $.ajax({
        type: "POST",
        data: {info: information, "action": "getUserRecords"},
        url: "/var/www/pinboard/wp-content/themes/pinboard/userinfo.php",
        success: function(msg) {
            $('.userDetail').html(msg);
        }
    });
    
    </script>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: