I'm facing an issue with a read/write error in my JavaScript code because the JSON file seems to be set as read-only ('Uncaught TypeError: Cannot assign to read only property'). How can I change it to writable? Should I make changes in the JavaScript or in the JSON itself?
Here is a snippet of my JSON array (Should 'writable: true' be added here?):
{ "lots" : [
{
"name" : "NW Corner of HW30 & 54th",
"info" : "$2/Hr<br>Monthly Parking Available",
"center" : {
"lat" : 57.659390,
"lng" : -127.414754
},
"topLeft" : {
"lat" : 57.659616,
"lng" : -127.415102
},
"bottomRight" : {
"lat" :57.659208,
"lng" :-127.414371
}
}...etc
]}
Here's the Ajax call I'm making (Is it possible to specify 'writable' using Object.defineProperty() here?):
var jsonFile = $.ajax({
type: "GET",
url: "filepath/filename.json",
dataType: "json",
success: function(response) {
console.log(response);
}
});
Do I need to declare this elsewhere, or am I missing something else entirely?
Thank you for any assistance provided.