简体   繁体   English

是否可以包含符号链接中的javascript文件

[英]Is it possible to include a javascript file from symbolic link

I have a php web app. 我有一个PHP Web应用程序。 I'd like to know: 我想知道:

  • Should I place my js files in my private dir 我应该将我的js文件放在我的私有目录中吗
  • (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放在公共目录中没有任何危害,因为js仍将由浏览器全部加载。 Js gets loaded in the dom and can be viewed easily by firebug or any javascript inspector. Js被加载到dom中,并且可以由Firebug或任何javascript检查器轻松查看。 If you still want to, then you can put it in a private directory, and call it using php. 如果仍然需要,则可以将其放在私有目录中,并使用php进行调用。 For example: 例如:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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