Click here to Skip to main content
15,941,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI team

I am getting 404 status each time inspect from the browser, i get uncaught exception for using vis.min.js libraries. Some how these are configured and did them via nuget command and they do reside from the project. What could be the reason for this issue?

What I have tried:

@model CheckTimeLine.Models.SelectOption
@{
    ViewBag.Title = "Home Page";
}

<h2>TimeLine</h2>

<!-- CSS -->

@section scripts{

    <!-- CSS -->
    <script src="~/Scripts/vis.min.js"></script>
    <!-- JS -->
    <link href="~/Content/vis.min.css" rel="stylesheet" />

    <script type="text/javascript">

        $(document).ready(function () {


            $.ajax({
                type: "GET",
                url: "GetAll",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: ChartVis,
                error: OnError

            });


            function ChartVis(response) {
                // DOM element where the Timeline will be attached
                var container = document.getElementById('visualization');

                // Create a DataSet (allows two way data-binding)
                var items = new vis.DataSet(response);

                // Configuration for the Timeline
                var options = {};

                // Create a Timeline
                var timeline = new vis.Timeline(container, items, options);
            }
            function OnError(response) {
                alert("Error !");
            }


        })

    </script>

}
<div id="visualization"></div>


// vis error
vis.js:20107 Uncaught Error: Property "start" missing in item [object Object]
    at new o (vis.js:20107)
    at n.<anonymous> (vis.js:18462)
    at Array.forEach (<anonymous>)
    at n._onUpdate (vis.js:18439)
    at n.setItems (vis.js:18292)
    at o.setItems (vis.js:40905)
    at new o (vis.js:40826)
    at Object.ChartVis [as success] (Index:91)
    at fire (jquery-3.4.1.js:3291)
    at Object.fireWith [as resolveWith] (jquery-3.4.1.js:3421)
Posted
Updated 18-Oct-21 3:07am
v2
Comments
Richard MacCutchan 18-Oct-21 7:51am    
Try removing the "~/" from the start of the src path.
Tgcobza Mkontwana 18-Oct-21 8:43am    
@Richard, i have and now im getting a complaint again. Please on the updated topic, highlighted on the comment current error.
Richard MacCutchan 18-Oct-21 8:55am    
OK, it seems that the library is now being loaded. However, I am afraid I cannot help with the error messages as that is something to do with the actual implementation of this library. You need to check the documentation to make sure your usage is correct.
Tgcobza Mkontwana 18-Oct-21 9:02am    
@Richard that is fine, will research by looking at the documentation and visit their forum for more information.

1 solution

As mentioned in comments 404 means it cannot be found so the url to the file was not correct.

As for the next error, it looks like you may be missing a required js file or have not set something. The error is happening in vis.js and if you did not write it, it likely has a bug or you have missed a step in implementing it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900