0

In my ASP.NET app I am using Jquery datatables plugin like this:

    <script type="text/javascript">
      $('#grdData').DataTable({
          "language": { "url": "Scripts/json/table-language.json" }
      });
   </script>

when running this on localhost it works fine and it fetches the json file. But in production I get a 404 not found error. I guess it somehow relates to relative path... any ideas on how to fix the path so it would work?

1
  • 1
    "/Scripts/json/table-language.json" try this instead Commented Jun 7, 2017 at 10:45

2 Answers 2

1

I found the problem. It was related to IIS, I needed to add Mime Type of .json extension and it did the trick.

Sign up to request clarification or add additional context in comments.

Comments

0

Can use way '../data/dataTables/german.json'

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.