ewrwr ewrwr - 4 years ago 160
Javascript Question

AngularJs wont link with JSON

For some reason as you can see my Angular Js cant link, here is the site im using. I dont know, is it something wrong with website I dont know. You can check the actual console for problem since i dont understand it. Thanks for helping!


<!DOCTYPE html>
<html lang= "en">

<meta charset="UTF-8" />
<title>Basic Login Form</title>
<script data-require="angular.js@1.4.x" src="https://code.angularjs.org/1.4.8/angular.js" data-semver="1.4.8"></script>
<script src = "https://rawgit.com/nirus/Angular-Route-Injector/master/dist/routeInjector.js"></script>
<script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular-route.js"></script>
<script type="text/javascript" src="main.js"></script>

<body ng-app = "app">
<div ng-view>
<div ng-controller = "people">
<h2>Names And Ages of Programmers:</h2>
<li ng-repeat = "person in persons">
{{person.Name + ' : ' + person.Age }}




var app = angular.module('app',[])

app.controller('people', function($scope,$http)
$scope.persons = response.records;


"records" : [
"Name": "Anonymus",
"Age" : "???"


Answer Source

I'm not sure if you can use HTTP request to access files located on an ftp servers. As I tested your urls, it seems that it's requiring authentication.. so even a simple ajax request using get wouldn't work.

To get the request to work, you'll need to have some sort of authentication. Your server seems to handle basic auth.

so you should have to change your url to:


If the ftp server support http requests, It should work...Yet, you're breaking the same origin policy. So it won't work unless your ftp server expose some sort of header to Allow Cross Origins.

You should host the json file at the same place as the html files and link it with http.

Looking at your ftp url, I guessed that the right http url should be:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download