javascript - ajax request JSON file, personal virtual host is ok, company server reports error 404 JSON file not found
阿神
阿神 2017-05-19 10:16:29
0
3
473

1. As in the title

JS part

<script>
    $(function(){
        $.ajax({
            url:'test.json',
            type:'get',
            dataType:'json',
            success:function(data){
                console.log(data)
            }
        })
    })
</script>

Browser console error reporting part
GET http://www.siemensgabor.com/t... 404 (Not Found)
Sometimes this is the error message:
Failed to load resource : the server responded with a status of 404 (Not Found)

Note: The location of the JSON file is definitely correct, and there is no problem with hosting your own website on the virtual host

阿神
阿神

闭关修行中......

reply all(3)
迷茫

There is no direct access from the browser...

The problem should be with your company’s server.

漂亮男人

It may also be due to the LAN. You and your virtual machine are on the same LAN, but you are no longer on the same LAN as the company.

给我你的怀抱

Try requesting to write an absolute path

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template