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

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

html - How to custom Bootstrap grid height? -