简体   繁体   中英

Is it possible to include a javascript file from symbolic link

I have a php web app. I'd like to know:

  • Should I place my js files in my private dir
  • (if so), can/do I include from symbolic link in the public directory.

There isn't any harm in placing your js in a public directory, since js will still be loaded by the browser in its entirety. Js gets loaded in the dom and can be viewed easily by firebug or any javascript inspector. If you still want to, then you can put it in a private directory, and call it using php. For example:

<script type="text/javascript" src="<?php echo $locationOfJS; ?>"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM