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 8216743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:14:11+00:00 2026-06-07T12:14:11+00:00

I am sending post data via ajax, and that data looks like this: var

  • 0

I am sending post data via ajax, and that data looks like this:

var cardProperties = {
    container: $("#cardContainer"),
    elementsWrapper: $("#cardElementsWrapperBorder"),
    size: 0, //0 -> (90x50mm <-> 510px x 283px), 1-> (85x55mm <-> 482px x 312px)
    position: "h", //default horizontal
    bgImagesPath: "media/images/designs/backgrounds/", //path to card bg images
    floatingImagesPath: "media/images/designs/floating-images/", //path to card bg images
    imagesPerPage: 8,
    innerBorderMargins: 40, //this should be divided by 2 to get the actual margin
    currentCardSide: 1
};

So basicly there is some usual data, but fields like container or elementWrapper is probably containing a lot of information about that object and also it’s child objects, so this is causing me very ugly error Uncaught RangeError: Maximum call stack size exceeded and since i don’t need those two fields how could i exclude it from the object without deleting any of that info, since i will need that stuff later in my js script.

EDIT

Also here is my ajax code:

$.post("server.php", {data: cardProperties},
   function(response){

   }
);
  • 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-07T12:14:13+00:00Added an answer on June 7, 2026 at 12:14 pm

    Remove functions and objects and you’ll just have those strings and numbers:

    var propertiesForAjax = (function(obj){
            var out = {};
            for(var i in obj){
               if(typeof obj[i]==='object' || typeof obj[i]==='function') continue;
               out[i] = obj[i];
            }
        })(cardProperties);
    

    Or without the self-executing function:

    function transformProps(obj){
       var out = {};
       for(var i in obj){
           if(typeof obj[i]==='function' || typeof obj[i]==='object') continue;
           out[i] = obj[i];
       }
    }
    
    var toPost = transformProps(cardProperties);
    

    Notes:

    • if you’re transforming an object, you’d need to try something slightly different (check against a list of valid objects for example)
    • if you don’t know what you’re transforming, you probably shouldn’t use this, as you could have unexpected output/lose things.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When sending data via POST or GET with jQuery you use for format {
I have this piece of AJAX that validates the login credentials by sending the
i have created custom query which i am sending via POST ajax but problem
How do I send AJAX data through $.ajax() in JavaScript via type: POST using
I'm sending a large amount of text to my webpage by POST that's received
I have a page where the user sends data (via ajax) to a php
I have a problem posting file via ajax jQuery function. I have something like
I am trying to POST a raw string via jQuery.ajax() e.g., contact_list=352345 I have
I am sending an Array of values through Ajax via jQuery with a Play
I have web methods that are called via AJAX in a .Net 4.0 web

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.