EL FRASKA wrote:
Hi im making a website and i need include a javascript (javascript.js)
but it isnt in www directory (i cant put src="http://.....) . There is
some way to call that javascript like an php include? (out of www dir)
Thank you very much :D
Hi,
If you cannot make an
http://etc to reach the JS, the clientbrowser will not
be able to do this either.
Remember that a JS-include is nothing more than a new request to some URL to
retrieve the file.
Solutions:
1) Move your JS file to a place where it can be reached via a normal
http://etc request.
2) Make the server include the JS directly into your HTML.
You need serverside scripting to do this.
I would recommend option 1 because it is simple to implement.
In case you think your JS-file is very secret for some reason, think again.
(I heard a few people saying such things)
It is delivered to a client browser, so it will never be a secret.
Regards,
Erwin Moller