Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8854009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:47:07+00:00 2026-06-14T13:47:07+00:00

Possible Duplicate: $.post throwing Illegal invocation I’m getting the following error when trying to

  • 0

Possible Duplicate:
$.post throwing “Illegal invocation ”

I’m getting the following error when trying to submit a AJAX request: Uncaught TypeError: Illegal invocation. Here’s the code: http://pastie.org/private/px6qinlgydv6cgcwrghvxw and the issue disappears if I remove the $.ajax() function.

 <script type="text/javascript">
            $(document).ready(function() {
                $('.inquiry-button').on('click', function(e) {
                    if($('.x-box ul li').length > 0) {
                        $('.x-box, .x-box-bottom').fadeOut('slow', function() {
                            $('.inquiry-form, .inquiry-buttons').fadeIn();
                        })
                    }


                })
                $('.edit-inquiry-submit').on('click', function(e){
                    e.preventDefault();
                    $('.inquiry-form, .inquiry-buttons').fadeOut('slow', function() {
                        $('.x-box, .x-box-bottom').fadeIn();
                    })
                })

                $('.inquiry-submit').on('click', function(e) {
                    e.preventDefault();
                    var valid = 1;
                    var name = $('#your_name');
                    var email = $('#your_email');
                    var company = $('#company_name');

                    if (!name.val() && valid == 1) {
                        var valid = 0;
                        name.focus();           
                        alert('Please provide your Name');
                    }
                    if (!email.val() && valid == 1) {
                        var valid = 0;
                        email.focus();
                        alert('Please provide your Email Address');
                    }
                    if (!company.val() && valid == 1) {
                        //   var valid = 0;
                        //  company.focus();
                        //  alert('Please provide your Company Name');
                    }

                    if (valid == 1) {
                        $('#i-form, .inquiry-buttons').fadeOut('', function() {
                            $('.inquiry-thank-you').fadeIn('', function() {
                                $.ajax({
                                    url: 'http://projectsxxxxxdev.com/cooling/wp-admin/admin-ajax.php',
                                    data: {'action' : 'sendProducts', 'name' : name, 'email' : email, 'company' : company},
                                    dataType : 'json',
                                    type: 'POST',
                                    success : function(data){
                                        console.log(data)

                                    }})


                            });
                        });

                    }
                })  


            })


        </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:47:08+00:00Added an answer on June 14, 2026 at 1:47 pm

    You’re trying to pass jQuery objects in your data parameter, call .val() to use their values

    $.ajax({
        url: 'http://projectsxxxxxdev.com/cooling/wp-admin/admin-ajax.php',
        data: {'action' : 'sendProducts', 'name' : name.val(), 'email' : email.val(), 'company' : company.val()},
         dataType : 'json',
         type: 'POST',
         success : function(data){
             console.log(data)
         }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: handle json request in PHP The following: $.ajax({ type: 'POST', url: 'receive-json.php',
Possible Duplicate: JavaScript post request like a form submit I have a value calculated
Possible Duplicate: PHP detecting request type (GET, POST, PUT or DELETE) This should be
Possible Duplicate: jQuery: How to stop AJAX function escaping JSON string used to POST
Possible Duplicate: How to simulate browser HTTP POST request and capture result in C#
Possible Duplicate: jQuery ajax() vs get()/post() what is the difference between jQuery ajax() and
Possible Duplicate: PHP detecting request type (GET, POST, PUT or DELETE) I want to
Possible Duplicate: $.ajax context option I've got some code that looks like this: $.post(self.baseUrl
Possible Duplicate: Facebook Connect error: can't post to wall in iPhone I had a
Possible Duplicate: jQuery $.get or $.post to catch page load error (eg. 404) Maybe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.