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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:40:42+00:00 2026-06-07T14:40:42+00:00

How would code the success callback function below to be able to access the

  • 0

How would code the success callback function below to be able to access the objects in the returned JSON below. Obviously I won’t be able to access the returned objects using, success: function(data) {if (data.returned === true) { anymore. How would I accomplish this?

jQuery Code:

$("#projects").click(function() {
                jQuery.ajax({ type: "POST", dataType: "JSON",
                    url: "<?=base_url()?>index.php/home/projectsSlider",
                    json: {returned: true}, success: function(data) {
                        if (data.returned === true) {
                            $("#resultProjects").html(JSON.stringify(data.Projects));
                            $("#resultScreenshots").html(JSON.stringify(data.Screenshots));

                            $("#content").fadeOut(150, function() {
                                $(this).replaceWith(projectsSlider(data.projectId, data.projectName, data.startDate, data.finishedDate, data.projectDesc, data.createdFor, data.contributors, data.screenshotURI, data.websiteURL), function() {
                                    $(this).fadeIn(150);
                                });
                            });
                        }
                    }
                });
            });

Returned JSON:

{
    "Projects": [
        {
            "projectId": "932713684f9073189ec7b",
            "projectName": "Cloud859Collective",
            "startDate": "April 19th, 2012",
            "finishedDate": "April 25th, 2012",
            "createdFor": "ClasskCreations",
            "contributors": "Mike Grigsby",
            "projectDesc": "This website was created with a friend in mind. His name is Kevin Johnson and he is a rapper. He needed a website that would allow him to host and share his music."
        },
        {
            "projectId": "10599012654f907093714e9",
            "projectName": "Nurbell Studio",
            "startDate": "April 15th, 2012",
            "finishedDate": "April 19th, 2012",
            "createdFor": "Nurbell LLC",
            "contributors": "Mike Grigsby",
            "projectDesc": "This is the page you are currently looking at. This is the official Nurbell homepage. Complete with a frontend and a backend."
        }
    ],
    "Screenshots": [
        {
            "screenshotURI": "http://nurbell.com/vd/1.0/images/project-data/kevo.png"
        },
        {
            "screenshotURI": "http://nurbell.com/vd/1.0/images/project-data/nurbell.png"
        }
    ]
}
  • 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-07T14:40:44+00:00Added an answer on June 7, 2026 at 2:40 pm

    I’m not sure what your asking here. I think you should take a look at javascript namespacing. That way you can create a property in your object (or namespace) and put the json result in that property.

    something like this:

     var myProjects = {
         projects: null,
    
         getProjects: function() {
               // do the ajax thing with something like
               myProjects.projects = data.projects;
         },
    
         placeProjects: function() {
               if (myProjects.projects == null) myProjects.getProjects();
               $.each(myProjects.projects, function(i,e){
                    //place project content
               }
         },
     }
    
     // define the click event
     $("#projects").click(myProjects.placeProjects());
    

    The data will be stored until you delete it or reload the page. You can see this object in the DOM inspector in your firebug. Hope that helps

    EDIT :

    I’ve implemented the idea in this jsFiddle http://jsfiddle.net/BTbJu/5
    Run it, click on the text int the Div to load the first project. Keep clicking to rotate.

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

Sidebar

Related Questions

In the code example below the success callback function logs 'input#04.update' four times rather
I would like to see how this example of existing code would be able
I'm curious if following code would be considered safe? using (SqlConnection cn = new
Can anyone tell me why this code would not be working? $('body').on('test', function() {
if f = g + h then where in the below code would I
I'm using XMLHttpRequest, and I want to access a local variable in the success
Here is the code I'm using for the submitHandler: submitHandler: function() { $('.holder').fadeOut('slow'); $('#loading').fadeIn('slow');
I am using multiple asynchronous air.URLLoader objects, and would like the events fired to
$.ajax({ type: POST, url: , data: callback=delete_contact_us_entry&offset= + posts + &numposts= + num, success:
Below is my Jquery code and I would like to pass Session paramater e.g.

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.