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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:27:36+00:00 2026-05-15T09:27:36+00:00

I have a beginner level Json question with MVC.net (I’ve never really used jquery

  • 0

I have a beginner level Json question with MVC.net (I’ve never really used jquery or json) so please excuse me if I ask something stupid.

I have a javascript file with the below

<script>
    function refreshMovies() {
        //$.getJSON("/Home/Refresh", showMovies);
        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "/Home/Refresh",
            success: showMovies
        });
    }

    function showMovies(movie) {
        var frag = "<ul>";
        frag += "<li>" + movie[0] + " - " + movie[1] + "</li>";
        frag += "</ul>";         
        alert(frag);
        $("#divMovies").html(frag);
    }
</script>

My Home controller looks like:

public ActionResult Refresh()
{            
        return Json(GetMovies());   // Method Returns IList<Movies>
}

The question I have is the frag on the alert and when the UL is displayed on the page is always empty.

However, firebug does show that the post request is returning the json, so maybe something is going wrong with showMovies()?

  • 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-15T09:27:36+00:00Added an answer on May 15, 2026 at 9:27 am

    You say that firebug reports that you are getting your JSon correctly, otherwise I’d ask you whether you decorated the action with [HttpPost], as you are using the POST method.

    Does the alert() currently display the correct HTML? If so, does the div have the id=”divMovies” attribute (note, no # character here!).

    Otherwise, try to move the alert() on top of the showMovies: does it show anything?

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

Sidebar

Related Questions

This is a beginner level question for asp.net MVC I have the following code
Excuse the beginner level of this question. I have the following simple code, but
Beginner level question Scenario: Have simple string cocantation tool, that I might expand later
This is a beginner-level question. I have a catalog of mtypes: mtype_id name 1
I have a beginner's question. I was wondering about the level of subviews and
I'm new to Java and I have a beginner question: NumberFormat is an abstract
Absolute beginner question: I have a template file index.html that looks like this: ...
Please see screenshot: Goal: id like to have comments nested 1 level deep The
I'm beginner level jquery and I setup this script but i need to modify
First to tell you i am really new to WPF I have some Question

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.