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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:57:17+00:00 2026-06-04T04:57:17+00:00

controller: def get_nodes … render :text => nodes.to_json.to_s end which renders valid JSON (

  • 0

controller:

def get_nodes
  ...
  render :text => nodes.to_json.to_s
end

which renders valid JSON ( Its picked up and parsed by my chrome plugin )

I’m using this in my JS:

var nodes = $.get('http://localhost:3000/users/get_nodes/4fb2739045a86e0c5c000002');
console.log(nodes); 

console.log output: https://i.stack.imgur.com/2l7pX.png

I’m able to get the data successfully however all I want is the ‘responseText’ saved into the ‘nodes’ variable.

I’ve managed to isolate it to this code by replacing this dynamic var with a static one ( in that case it behaves as expected )

  • 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-04T04:57:20+00:00Added an answer on June 4, 2026 at 4:57 am

    $.getJSON() and $.get() do not return the JSON or other response that was fetched. To retrieve that, you need to pass a success handler to getJSON() and it will get called AFTER the network operation is complete when the data is available.

    You also need to know that the function is normally asynchronous which means it returns immediately and some time later your success handler is called with the retrieved data.

    See the getJSON jquery doc for info.

    $.getJSON('http://localhost:3000/users/get_nodes/4fb2739045a86e0c5c000002', function(data) {
        // you can access your data here in the "data" variable passed to this success handler
        console.log(data);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two actions in my controller : def find @item = Item.find(params[:id]) render
I have this controller: def list = { withFormat { xml { render Customer.list()
Here is my controller: def sedomain @domain = params[:domain] @virksomhed = Virksomhed.find(:all) end Virksomhed
I have the following in my controller: def index @games = Game.gamsearch(params[:gamsearch]) end def
I have this method in my videos controller: def notifications erase_notification_count end It calls
I have a controller and a view (ctrler) controller def index ... end def
I have a controller like this : @Secured(['ROLE_USER','IS_AUTHENTICATED_FULLY']) def userprofile(){ def user = User.get(springSecurityService.principal.id)
I have the following application_controller method: def current_account @current_account ||= Account.find_by_subdomain(request.subdomain) end Should I
def filters = { forUser(controller:'user', action:'*') { before = { user=springSecurityService.getCurrentUser() log.info(came to filter
I have a controller method that is a little something like this: def suggestions

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.