0
Hello, Community!
My question is about how the reference to external files works in a Javascript file also external. I explain!
Suppose I have three files: index.php
, json.php
and javascript.js
with the following structure
/
index.php
js/
javascript.js
data/
json.php
The Javascript file has the following code, referencing the file json.php
:
$.getJSON( "../data/json.php", function( data ) {
//faz alguma coisa aqui
});
Now, if I include the Javascript file in the file index.php
the reference to the archive json.php
is lost, although it is technically correct to use the relative reference in the file .JS
.
How does that explain?
Humn! We have one serial downvoter around here. I don’t mind that you deny the question, but at least justify it for the sake of other people’s judgment.
– StillBuggin