You have to remember your context. Your CF application's context is on the
server side, and usually includes are relative to the page you are including
from. Images are included from the client side - the browser, so they are
relative to the URL of the current page.

Often, it helps to include your images in a web-root-relative path, so your
src would always start with a slash. "/images/photo.jpg" instead of the
relative locations "images/photo.jpg" or "../images/photo.jpg" - this way,
it doesn't matter where your page is, as long as it's on the same site.

HTH

nathan strutz
[http://www.dopefly.com/] [http://hi.im/nathanstrutz]


On Fri, Jan 21, 2011 at 12:31 PM, fun and learning
<[email protected]>wrote:

>
> Hi All -
>
> I have a strange situation with relative paths. When I use a relative path
> in cfinclude it works. But when I use a relative path is "src" attribute of
> <img>, it does not work. Can anyone suggest why could this be happening?
>
> Thanks
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341101
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to