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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:12:53+00:00 2026-06-02T17:12:53+00:00

I am attempting to load some json data into a custom JQuery function. There

  • 0

I am attempting to load some json data into a custom JQuery function. There is probably an easy solution to this by I am admittedly learning as I go. Please advise if I am just going about it the wrong way.

As of now I am just appending it into the body to ensure that I am actually finding the data properly. I was trying to use append() to add it into the function as well but was not getting any where.

$.getJSON("designs/new.json",function(result){
        $.each(result, function(i, field){
            $("body").append(field['hex'] + " ");
        });
});

Essentially what I’d like to do is replace the hex data values for this colorPicker function with the hex codes from my json data above. I’ve been messing with it for a while and can’t seem to find the right approach.

$.fn.colorPicker.defaults.colors = ['000', '000', 'fff', 'fff'];

I appreciate the help in advance!

  • 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-02T17:12:56+00:00Added an answer on June 2, 2026 at 5:12 pm

    Try using alert(JSON.stringify(result)) to see if your json data is loaded properly. This code should work:

    $.getJSON("t.json", function (result) {
      //alert(JSON.stringify(result));
      $.fn.colorPicker.defaults.colors = result.colors;
    });
    

    where t.json has the following content:

    {
      "colors": ['00a', '00b', 'ffa', 'ffb']
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to load JSON (from php's json_encode) into a Backbone JS collection. I've
I'm attempting to load a dll into MSSQL with: USE dbname GO CREATE ASSEMBLY
Attempting to use the data series from this example no longer passes the JSONLint
Im attempting to utilize some custom script and css files within an asp page.
I'm attempting to dynamically load a select box's options based on some existing criteria
I'm attempting to parse load a rather complicated XML schema into a Schema object
I'm using JQuery to make a JSON request to access data on a private
I'm having issues getting this JSON object to load via JSONP in Chrome 18
I am attempting to load document files into a document library in SharePoint using
I'm attempting to utilize some code found here: http://androidtabs.googlecode.com/svn/trunk/ This includes the bases classes

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.