2

I have installed xampp and in the htdocs folder I have a folder called drupaldev. I need to give reference to a image in javascript but my images doesn't display. 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!

4
  • More information, please. What is the full local path of the image? What is the current output rendered to the page? Commented Apr 4, 2011 at 5:27
  • localhost/drupaldv/sites/all/modules/finder/images/check.jpg when I use this in my browser it displays the image... Image is in C:\xampp\htdocs\drupaldv\sites\all\modules\finder\images\check.jpg Commented Apr 4, 2011 at 5:36
  • Can you post your JavaScript? Commented Apr 4, 2011 at 5:49
  • finally I found the reason, it's an issue of having 2 window.addEvent('domready', function()..... Thanks a lot for the concern everyone :-))))) Commented Apr 4, 2011 at 10:30

1 Answer 1

1

You can make use of Drupal.setting.basepath variable. This gives you the document root for the drupal instance you are running. Append the rest of the required file path to this variable.

Hope this helps!!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.