Home  >  Article  >  Backend Development  >  关于smarty定义绝对路径在<script 中使用解决方案

关于smarty定义绝对路径在<script 中使用解决方案

WBOY
WBOYOriginal
2016-06-13 13:34:08878browse

关于smarty定义绝对路径在<script>使用了smartty定义了根目录<br /><br />define("Path", dirname(__FILE__)."/");<br /><br />Path(值为) D:\xampp\htdocs\mytest/<br />模板 .tpl文件位于 D:\xampp\htdocs\mytest/smarty/templates 下<br />jquery库文件位于 D:\xampp\htdocs\mytest/ 下<br /><br /><br /><br /><br /><br />在模板(.tpl)文件中加载jquery库文件, src=".././jquery-1.6.js"使用相对路径没问题,<br /><br />但是使用<script language="javascript" src={$Path}."jquery-1.6.js"></script>

则jquery加载不上,求解。

------解决方案--------------------
你搞清楚,这个define("Path", dirname(__FILE__)."/");是个怎样的路径

浏览器加载需要怎样的路径先
------解决方案--------------------

探讨

换句话说
我用 都没问题
可是用 却加载不上
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn