I'm trying to retrieve data from a web service using vue.js, but I'm having trouble fetching the data. Can I use vue.js without installing node.js? Any help would be appreciated. Thank you in advance.
<!DOCTYPE html>
<html lang="en>
<head>
<title> </title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="76000313364458465845">[email protected]</a>/dist/vue.js "></script> <script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="04727161297661776b7176676144352a342a37">[email protected]</a>/dist/vue-resource.min.js"></script>
</head>
<body>
<div id="app">
<table border=1>
<thead>
<tr>
<th> title</th>
</tr>
</thead>
<tr id="app">
<td>{{data.title}}</td>
</tr>
</table>
</div>
<script type="text/javascript">
var dataURL = 'https://swapi.co/api/films/?format=json';
var App = new Vue({
el: '#app',
data: {
posts: [] // starting with an empty array
},
mounted() {
var self = this
$.getJSON(dataURL, function(data) {
self.posts = data.results;
});
}
})
</script>
</body>
</html>