javascript - Remove &quot from json using laravel -


hello wanted know how use blade variable in javascript. here query in laravel

$users=json_encode(db::table('ledger')->select('name','openingbalance')->get()); 

i'm trying access in javascript file shown below

var users ="{{ $users }}"; 

and output shown below:

[       {"name":"harsh","openingbalance":"5755.00"},             {"name":"harh","openingbalance":"-12000.00"},       {"name":"gfgfhgf","openingbalance":"-333.00"} ] 

i wanted know how remove &quot perfect json use.

you're escaping data {{ }} automatically in laravel 5. use {!! $users !!} instead.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -