Since I can just put something like
Is this a “good” or “bad” practice?
AFAIK browsers won’t balk at it. The only possible problem I can think of is that some may be able to see that its a generated file and maybe exploit the fact?
You may want to use some expire nocache headers too.
Cool, I just really dislike it when I have to put the actual script on the page it self >_<. So if I avoid using http queries like $_GET I should be fine?
I’ve used both $_GET and $_POST to fetch JSON without any problems. Just be careful to validate and sanitize as should be the case always anyway.
I do a lot of my CSS and js includes that way so I can use php variables inside the scripts or stylesheets. No measurable downside.