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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:23:55+00:00 2026-05-24T11:23:55+00:00

I have a generated array which if hard coded passes the array objects to

  • 0

I have a generated array which if hard coded passes the array objects to a function for processing fine.

For example:

$("#termCloud").jQCloud([{text:'some',weight:10},{text:'thing',weight:8}]);

However, I need to make this more dynamic so am generating the the array externally and importing using ajax. This is what I’m Trying:

(generateArray.asp would output {text:'some',weight:10},{text:'thing',weight:8})

$.ajax({
    url: '/generateArray.asp',
    success: function(data){
        $("#wordCloud").jQCloud([data]);
    }
})

I have tried several dataTypes and all fail.

The problem seems to be that the in the working version the JQCloud plugin receives the array as objects: [object Object],[object Object] where as my ajax version receives/sends it as a string: {text:'some',weight:10},{text:'thing',weight:8}

Is there a way to import the the array and pass it though to the JQCloud function/plugin as a proper array rather than a string or convert the string to an array for processing?

Many thanks..

In repospone to two answers below; I should point out that the return doesn’t seem to be recognised as valid JSON data…

  • 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-24T11:23:57+00:00Added an answer on May 24, 2026 at 11:23 am

    I guess you should JSON-parse the data variable before sending it to the plugin:

    var json = JSON.parse(data);
    $("#wordCloud").jQCloud([json]);
    

    …or you could add

    dataType : 'json'
    

    …to the settings parameter in the ajax function call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a generated nested Array which I store some data. How can i
I have an indexed array which I've generated from an associative array with this
I have generated inputs with price values. Example: <input type=text value=59,00/> Now I should
I have an array like below which is generated by parsing a xml url.
I have an array which is generated from an XML file and it shows
I have an array of button which is dynamically generated at run time. I
I have an array which contains many keys/values that are generated dynamically, so I
I have a multi-dimensional array of databases, which was generated from my server: //
I have seven words in the array: string[7] = {x,x,x,x,x,x,x}; the x is generated
I have generated using openssl mycert.pem which contents the certificate. And I converted the

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.