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

  • Home
  • SEARCH
  • 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 8183163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:04:41+00:00 2026-06-07T01:04:41+00:00

I have a function, SWFUpload_config , which takes an argument, post_params_arr – an object.

  • 0

I have a function, SWFUpload_config, which takes an argument, post_params_arr – an object.

post_params_arr = {"ajaxtask":"swfupload_files", "param": "2012"}

I need to parse that post_params_arr and dynamically add keys and values to swfu_settings in the following way (please notice that swfu_settings has by default ‘SWFSESSID’ : session_id and all other keys:values must be added from post_params_arr):

function SWFUpload_config (post_params_arr) {
    var swfu_settings = {
        'SWFSESSID' : session_id,
        'ajaxtask' : 'swfupload_files',
        'param' : '2012'
    };
}

How can I achieve that? How would I parse post_params_arr inside swfu_settings where I am assigning keys and values?

  • 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-07T01:04:43+00:00Added an answer on June 7, 2026 at 1:04 am

    The same way you’d access any other object…

    var swfu_settings = {
        ajaxtask: post_params_arr.ajaxtask,
        param: post_params_arr.param
    };
    

    Or do you mean it’s JSON? If you have jQuery, parse it using jQuery.parseJSON; otherwise, use JSON.parse and fall back on eval('(' + post_params_arr + ')').


    If you need to shallow-clone the object for some reason, a for in loop will work:

    var swfu_settings = {
        SWFSESSID: 'blah'
        // etc.
    };
    
    for(var x in post_params_arr) {
        if(post_params_arr.hasOwnProperty(x)) {
            swfu_settings[x] = post_params_arr[x];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have function some_func_1 which will create an object of type some_type and will
I have function which takes in an parameter of a class called Triple, and
I have function bar which I need to call. I'm new to using callbacks,
I have function LoadTempMovieList(), and need to load movies from sessionStorage. But it seems
Inside my Controller i have function that runs after user clicks on item, which
i have function which return list as given below. List<User> lstUsers = SearchUsers(searchText); which
i have function, which has to accept two types of data - Observable collection
I have function in Javascript which works fine using prototype. The function is used
I have function getMemory() which returns VARIANT (mfc). It is said that in ulVal
I have function which return NSArray, but it's generating memory leak, since i can't

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.