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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:13:21+00:00 2026-06-16T18:13:21+00:00

For example, in an external JavaScript file I have this inside a simple $(document).ready

  • 0

For example, in an external JavaScript file I have this inside a simple $(document).ready function:

$.getJSON("/aTest.json", function (jsonObj) {
    $("#testJSONBtn").click(function () {
        var val = "";
        for (var i = 0; i <= jsonObj.events.length; ++i) {
            val += jsonObj.events[i].title + ", " + jsonObj.events[i].date + ", " + jsonObj.events[i].explanation + "<br/>";
        }
        $("#JSONOutput").append(val);
    });
});

JavaScript console keeps telling me that the server returned 404 (not found), however the file is definitely exactly that name, and exactly on that path. All other resources are accessed by the site just fine. I have tried moving the file around and renaming it, and a slew of other things, so I get the feeling that maybe this has something to do with WebMatrix, the version of IIS that its running (is it 8?), or the file extension I am using (.json). Aren’t external json files supposed to be stored in a file with the .json extension?

Additional Peculiarity:

I once had two files with the same name, one was the .json file and the other was.cshtml, and they were in the same directory. During this time the above function didn’t return a 404, in fact, it returned nothing at all… It did nothing, but it returned no errors.

If it matters, all ids and selectors have been quintuple checked (and beyond).

Is there something wrong with the above function somehow, or will an external .js file (or WebMatrix’s IIS) not access another external .json file like this?

  • 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-16T18:13:22+00:00Added an answer on June 16, 2026 at 6:13 pm

    It sounds like you need to add a static mapping for *.json files in your applicationHost.config. This post does a nice job explaining how to add a mime type to IIS Express:

    http://www.tomasmcguinness.com/2011/07/06/adding-support-for-svg-to-iis-express/

    You can also check out the IIS Express logs to see if there are more details in the log. They’re usually located at ~\Documents\IISExpress\Logs

    Happy Coding!

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

Sidebar

Related Questions

If I have a reference to an external third party JavaScript file on my
Let say that I have many Javascript inside pages. At this moment is pretty
I have to include an external javascript file as part of a Drupal project
$(document).ready(function () { $(href).attr('href', 'title'); }); $('a[href$=.jpg]').each(function () { var imageSrc = $(this).attr('href'); var
For example: script.js: function functionFromScriptJS() { alert('inside functionFromScriptJS'); } iframe.html: <html> <head> <script language=Javascript
I want to create a function in an external javascript file that I can
I'm trying to solve this problem : http://uva.onlinejudge.org/external/7/732.html . For the given example, they
I have a section of a webpage that loads a JavaScript file from an
I have encountered a very strange bug in Firefox. I have a javascript function
I am working on a web page that pulls an external javascript file that

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.