The following error is displayed:
Uncaught SyntaxError: Unexpected identifier
on line 12. I would like someone to help me fix this error.
The JS is as follows:
document.addEventListener("deviceready",onDeviceReady,false);
function onDeviceReady(){
var vm = new Vue({
el: '#app',
data:{
noticias: []
},
methods:{
sync:function(){
$.ajax({
dataType: 'json'
url: 'http://yhsoftware.esy.es/read.php',
success:function(dados){
localStorage.setItem('noticias',JSON.stringify(dados));
vm.setNoticias();
alert("lista de noticias atualizada!");
},
error:function(){
alert("ocorreu um erro durante a conexão com o servidor!");
}
}};
},
setNoticias:function(){
this.noticias = JSON.parse(localStorage.getItem('noticias'));
console.log(this.noticias);
}
},
ready:fuction(){