I am uisng python,To display data from json file to a page,i am getting the below errors
Failed to load resource: the server responded with a status of 404 (NOT FOUND) http://localhost:8000/static/script/jquery-1.9.1.min.js
Failed to load resource: the server responded with a status of 404 (NOT FOUND) http://localhost:8000/static/script/myscript.js
myscript.js file
$("#button").click(function(){
$.getJSON("item.json",function(obj){
$.each(obj,function(key,value){
$("ul").append("<li>+value.item1+"</li>");
$("ul").append("<li>+value.item2+"</li>");
$("ul").append("<li>+value.item3+"</li>");
});
});
});
.json file is
{
"p1":{
"item1":"apple",
"item2":"orange",
"item3":"banana",
},
"p2":{
"item1":"water",
"item2":"milk",
"item3":"alcohol",
}
}
template is
<html>
<head>
<body>
<ul></ul>
<button></button>
<script src="script/jquery-1.9.1,min.js" type="text/javascript"></script>
<script src="script/myscript.js" type="text/javascript"></script>
</body>
</head>
</html>
1).js file is in my project folder and path also setted.
2).I am not doing any query in my views.py,as i am new to this i am confused with this.So any codings need to perform in the views.py for fetching the data from json.
3).Not able to sort out the above errors,please provide me the possible reason so that i can run this function.
Thanks
<script src=
links directly in the browser and see what happens. I would expect 404 too, which would mean that thesrc
paths are wrong. – Akos Ksrc
is invalid and your script is placed elsewhere. – Akos K