absolute path to image in jquery code

maqskywalker
maqskywalker used Ask the Experts™
on
I'm using the jQuery UI DatePicker in my asp.net web forms application.


In my application directory folder which is called Application1 I have a folder called images where I put all my image files.

So the direct path through the web browser would be something like this:

http://www.mywebsite.com/images/CalendarIcon.jpg

In my jquery code I'm setting the path like this:

buttonImage: "images/CalendarIcon.jpg"

this works fine in my development server but for some reason when I deploy it to production the image doesn't show up.

This also worked fine.
buttonImage: "http://www.mywebsite.com/images/CalendarIcon.jpg"


anyone know why this path is not working on production iis7 server             buttonImage: "images/CalendarIcon.jpg"

anyone know how to write absolute path to this image?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Professional
Top Expert 2015
Commented:
use image path like (add leading slash), in your relative path, so it will add domain/application URL to it
buttonImage: "/images/CalendarIcon.jpg"

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial