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 a Javascript hash table, like so: var things = [ ]; things[hello]
Analyzing the location.hash with this simple javascript code: <script type="text/javascript">alert(location.hash);</script> I have a difficult
I have a hash very similar to the following JSON object; This is only
I have a simple object (or hash) in Javascript: var settings = { link:
So I have this JavaScript literal that is displaying a tree structure using arborjs.
I have a javascript functions which returns a hash. I need to pass this
I have Javascript that opens another window and registers a click handler for all
I have JavaScript that is doing activity periodically. When the user is not looking
I have javascript code embedded inside a html template file. When I load this
I have javascript string variable with var sttr=We prefer questions that can be answered

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.