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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:02:06+00:00 2026-05-28T05:02:06+00:00

When someone clicks on a page number on my little widget box, I fire

  • 0

When someone clicks on a page number on my little widget box, I fire out a request that returns a JSON result.

<script type="text/javascript">
    $(document).ready(function() {
        $('a').click(function(e) {
            e.preventDefault();
            $.ajax({
                type: "GET",
                url: "@Url.Action("FetchMiniNoticiasFromPage", "Noticias")",
                data: "page=" + $(this).text(),
                dataType: "json",
                success: function (data) {
                    alert("fetched!"); 
                    //This is returning exactly what I want.

                    /*Object { ImagenChicaUrl="http://www.dss.com.bo/img/iniciopro/can01.JPG", Descripcion="Lista de Precios de Enero 2012.", FechaDePublicacion="/Date(1326859200000)/"}

1
    Object { ImagenChicaUrl="http://www.dss.com.bo/img/iniciopro/can01.JPG", Descripcion="Una neuvo proyecto en el sistema!", FechaDePublicacion="/Date(1326168000000)/"}

2
    Object { ImagenChicaUrl="http://www.dss.com.bo/img/iniciopro/can01.JPG", Descripcion="asdfasdfasdfasdf", FechaDePublicacion="/Date(1326081600000)/"}

3
    Object { ImagenChicaUrl="http://www.dss.com.bo/img/iniciopro/can01.JPG", Descripcion="qwefqwef", FechaDePublicacion="/Date(1325563200000)/"}

4
    Object { ImagenChicaUrl="http://www.dss.com.bo/img/iniciopro/can01.JPG", Descripcion="asdfasdf", FechaDePublicacion="/Date(1323057600000)/"} */
                },
                error: function (obj) {
                    alert("bad!");
                }
            });
        });
    });
</script>

I want to create a li element for every object returned in the JSON result:

<li>
    <img src="ImageChicaUrl" alt="@miniNoticia.Descripcion"/>
    <a href="#">FechaPublicacion</a>
    <p>Descripcion</p>
    <div class="horizontal-line" />
</li> 

I’m not sure how to iterate through each JSON object, and then access it’s variables. Any suggestions?

  • 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-28T05:02:07+00:00Added an answer on May 28, 2026 at 5:02 am

    Try this

    var $liContainer = $('div.images');
    var data;//data returned from the ajax response
    $.each(data, function(i, val){
    
       $liContainer.append('<li>' +
            '<img src="' + val.ImagenChicaUrl + '" alt="' + val.Descripcion + '"/>' +
            '<a href="#">' + val.FechaDePublicacion + '</a>' +
            '<p>' + val.Descripcion + '</p>' +
             '<div class="horizontal-line" />' +
        '</li>');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Likes plugin that I've dropped on my page displays both the number of
I have a page with a lot of textboxes. When someone clicks a link,
I want to refresh my asp.net page after someone clicks an Add button. However,
I have an ecommerce site that, every time someone clicks on Add to Pallet
I have a number of links on my page that calls some jquery code
I'd like a link where if someone clicks a mailto link they are also
For example, when someone clicks on a button.
I'm looking for a way to expand a view when someone clicks on a
so, the thing is : when someone clicks on a link to my website
I have a webpage where I have an Iframe. When someone clicks something in

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.