简体   繁体   English

绝对路径问题

[英]absolute path problem drupal

I have installed xampp and in the htdocs folder I have a folder called drupaldev. 我已经安装了xampp,并且在htdocs文件夹中有一个名为drupaldev的文件夹。 I need to give reference to a image in javascript but my images doesn't display. 我需要引用JavaScript中的图片,但我的图片无法显示。 my image is in C:\\xampp\\htdocs\\drupaldv\\sites\\all\\modules\\finder\\images folder and I refered it in javascript as /drupaldv/sites/all/modules/finder/images ... What could be the reason for this... Please can someone explain... Thanks a lot! 我的图片位于C:\\xampp\\htdocs\\drupaldv\\sites\\all\\modules\\finder\\images文件夹中,我在javascript中将其称为/drupaldv/sites/all/modules/finder/images ...可能是什么原因为此...请有人解释...非常感谢!

You can make use of Drupal.setting.basepath variable. 您可以使用Drupal.setting.basepath变量。 This gives you the document root for the drupal instance you are running. 这为您提供了正在运行的drupal实例的文档根目录。 Append the rest of the required file path to this variable. 将其余所需文件路径追加到此变量。

Hope this helps!! 希望这可以帮助!!

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

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