Currently, I am attempting to load a JSON file and a set of images from a directory located above my root directory. Although the code I have works, I believe there may be a more efficient way to achieve this.
$.getJSON("http://localhost/folder1/folder2/folder3/content/LB/contents/content.json", function(json){
console.log(json);
}
as well as images
<img src="http://localhost/folder1/folder2/folder3/content/LB/contents/locations/locationname/thumbnail.png />
I am aiming to load the JSON and images from
http://localhost/folder1/folder2/folder3/content/LB/appdrive/html/someHTML.html
http://localhost/folder1/folder2/folder3/content/LB/appdrive/html/js/someJS.js
Using only HTML, CSS, and JavaScript, my main query is if there is a way to modify the source of the JSON and images to something like this
$.getJSON("folder2/folder3/content/LB/contents/content.json", function(json){
console.log(json);
}
and the image
<img src="../folder2/folder3/content/LB/contents/locations/locationname/thumbnail.png />
Lastly, it is important to note that FOLDER2 serves as the root directory.