Drawing to canvas using JSON file
问题 I am trying to call line info from a json object into a canvas using ajax. I'm new to json, so I'm not entirely sure how to go about doing this. Here's what I have so far. JSON { "line": { "width": 3, "stroke": "#FFFFFF", "x1": "640.386", "y1": "258.163", "x2": "816.364", "y2": "258.163" } } JS $(document).ready(function(){ var canvas = document.getElementById("schematic_holder"); var ctx = canvas.getContext("2d"); $.ajax({ type: "GET", dataType: "json", url: "js/app/json/nst.json", success: