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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:43:16+00:00 2026-05-25T11:43:16+00:00

I have a javascript hash (object?) we will call settings_hash that basically looks like

  • 0

I have a javascript hash (object?) we will call settings_hash that basically looks like this:

{ setting_1=90, setting_2=30, setting_3=19 }

And I’ve got a post that looks like this:

jQuery.getJSON("model/queries.cfc", {
    method: 'methodName',
    data: jQuery.param(settings_hash),
    }, function(data){
        // callback stuff goes here
    }
);

I really don’t like having to decode the data string on my queries page (it’s coldfusion- bleah). Is there an easy way to handle the decode a little better on the client side? So that what we functionally get is this:

jQuery.getJSON("model/queries.cfc", {
    method: 'methodName',
    setting1: 90,
    setting2: 30,
    setting2: 19,
    }, function(data){
        // callback stuff goes here
    }
);

Obviously if .serialize() or .param() is the way to go, then that’s fine. What I want to avoid is a big long string that I have to decode, like data=setting_1%3D90%26setting2%3D30%26setting3%3D19. Open to all solutions/feedback- if the big long string is really the way to go for some reason, convince me and you’ll get credit for the answer!

  • 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-05-25T11:43:17+00:00Added an answer on May 25, 2026 at 11:43 am

    Your “hash” isn’t a valid JavaScript object literal that can be serialized into JSON.

    Convert from what you have to simply using an actualy JS object literal, like this:

    var data = {
        method: 'methodName',
        setting1: 90,
        setting2: 30,
        setting2: 19
    }
    

    Then just pass to your AJAX call, no manual serialization necessary:

    jQuery.post(url, data, callback);
    
    function callback(d) {
        //stuff
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have javascript object defined like this: function SocialMiner() { var verbose=true; var profileArray=new
I have a JavaScript function, pop_item . I have to call this from PHP,
I have a javascript functions which returns a hash. I need to pass this
I have a JavaScript method that I need to run on one of my
I have a javascript function that manipulates the DOM when it is called (adds
I have a JavaScript resource that has the possibility of being edited at any
I have a JavaScript snippet that runs very well on Firefox and Safari, but
I have a JavaScript class that I have made and put it into its
I have a javascript routine that is performing actions on a group of checkboxes,
I have a javascript function (class) that takes a function reference as one paremter.

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.