Answer the question
In order to leave comments, you need to log in
What am I doing wrong, the value in the first name is not displayed?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="./js/jquery-2.1.4.js"></script>
<script type="text/javascript" src="./angular/angular.js"></script>
<script type="text/javascript" src="./bootstrap/js/bootstrap.js"></script>
<!-- <script src="//vk.com/js/api/xd_connection.js?2" type="text/javascript"></script> -->
<link rel="stylesheet" type="text/css" href="./bootstrap/css/bootstrap.css">
<script>
var myApp = angular.module('myApp',[]);
myApp.controller('profileCtrl', ['$scope', function($scope){
var req="https://api.vk.com/method/users.get?user_ids=1"
$.ajax({
url : req,
type : "GET",
dataType : "jsonp",
success : function(msg){
console.log(msg.response[0].first_name);
$scope.resp = msg.response[0].first_name;
}
});
}]);
</script>
</head>
<body>
<div class="container" ng-app="myApp">
<div class="profile" ng-controller="profileCtrl">
<div id="First_name">{{ resp }}</div>
<div id="Last_name"></div>
<div id="City"></div>
<div id="Avatar"></div>
</div>
</div>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question