output json object from python to javascript -


(new python) writing simple python function, outputting json javascript get.

when run python script on command line, output json object

print json.dumps(data) 

on js,

    this.$http.get(link_to_python_script).then(function(response){         console.log('data',response.data);     }, function(error){         console.log('http error',error.statustext);     }); 

when examine response on browser has header:

content-type:text/plain; charset=utf-8 

and in browser console.log prints out entire python script instead of json object. keep simple , not using addons. how can accomplish this?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -