I have a jqxChart on my webpage that I am loading from a local data array. When creating the chart, there is what appears to be a call to the base href for the page. The chart renders successfull, however Firebug reports a

"NetworkError: 404 Not Found - http://localhost/foo"

It does not provide a javascript source of the call, stating the call is from /foo/. However when I remove the $("#jqxChart").jqxChart(settings); call, the error is not thrown leading me to believe that it is something inside the chart initialization that is causing this. Has anyone seen this before or can tell me what is causing it? The test webpage I used is copied below. I am running jQuery v1.10.2 and jqwidgets v3.1.0

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">    
<head>
    <title></title>
    <base href="http://localhost/foo" />
    <script type="text/javascript" src="js/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="js/jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="js/jqwidgets/jqxdata.js"></script>
    <script type="text/javascript" src="js/jqwidgets/jqxchart.js"></script>
    <link href="js/jqwidgets/styles/jqx.base.css" type="text/css" rel="stylesheet" media="all" />
    <script type="text/javascript">
    //<![CDATA[
    var sampleData = [
        { calcTime : "Monday", value : 10 },
        { calcTime : "Tuesday", value : 20 },
        { calcTime : "Wednesday", value : 30 }
    ];
    $(document).ready(function(){
        var settings = {
            title : "Test Chart",
            description : "Network Error",
            source : sampleData,
            categoryAxis : {
                dataField : "calcTime",
                showGridLines : true
            },
            seriesGroups : [
                {
                    type : "line",
                    valueAxis : {
                        minValue : 0,
                        maxValue : 50,
                        axisSize : "auto",
                        description : "Test Values"
                    },
                    series : [{ dataField : "value", displayText : "value" }]
                }
            ]
        };
        $("#jqxChart").jqxChart(settings);
    });
    //]]>
    </script>
</head>
<body>
    <div id="jqxChart" style="width:600px; height:400px"></div>   
</body>
</html>
有帮助吗?

解决方案

That seems to be because of your code which seems to be not related to the jQWidgets Chart. Remove it and I suppose that there would be no Network Error

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top