[Vuejs]-VUE with JSONP, always shows SyntaxError: Unexpected token?

0👍

Since you are using this.$http it looks like you are using vue-resource.

Vue-resource is a promise based API. The syntax for the request should be

this.$http.jsonp('http://hq.sinajs.cn/list=fx_susdcad')
    .then((data) => { 
        console.log(data) 
    } );

And in the data property remove the ; as data is object
So it should be

data:{
     hq_str_fx_susdcad:''
     },

Leave a comment