Solved

Simple simple simple

Posted on 1998-12-04
5
130 Views
Last Modified: 2010-04-09
How can I do the following:

<body background="PATH_TO_ROOT_DIR/images/background.jpg">

You see, at my web site, I have one directory under the main directory called "images."  In it, I want to store all the pictures and graphics for the site.  I would like to be able to access the graphics in the directory from any other directory within the site.  The problem is, I don't know how.  Is there anyway to do this?

It seems simple, but I don't know.......

I also have a second question (probably even simpler).  How can I change the body of a mail message given something like this:

<FORM>
<INPUT TYPE="BUTTON" VALUE="Send" onClick="location.href= 'mailto:theletterp@hotmail.net?Subject= Just a few comments...'">
</FORM>

This too seems simple, but I don't know.  If you want more points, I suppose I can supply them 8-)
0
Comment
Question by:p021497
  • 2
  • 2
5 Comments
 

Author Comment

by:p021497
ID: 1840209
Edited text of question
0
 
LVL 2

Accepted Solution

by:
chrisbolt earned 20 total points
ID: 1840210
Replace PATH_TO_ROOT_DIR with .. to go to the directory under the current directory. For example, if this is your directory structure:

www.whatever.com/yourdir/index.html
www.whatever.com/yourdir/images/background.gif
www.whatever.com/yourdir/yoursubdir/yoursecondpage.html

In index.html the location of the background is images/background.gif and in yoursecondpage.html the path is ../images/background.gif

For the second question, do this:

<FORM>
<INPUT TYPE="BUTTON" VALUE="Send" onClick="location.href='mailto:theletterp@hotmail.net?Subject=Just a few comments...&body=Some stuff in the body'">
</FORM>
0
 
LVL 4

Expert Comment

by:martinag
ID: 1840211
It would be easier to use "/yourdir/images" all the time. Then you don't have to think about where this file is and where that file should be placed etc.

Martin
0
 

Author Comment

by:p021497
ID: 1840212
Thank you chrisbolt, you have solved my problems.  It works great now.

Martin, I am storing only one copy of some images on the server (to conserve space).  Your idea is easier to do, but it takes up more room.  I would rather not do that.  Thanks anyway though.
0
 
LVL 2

Expert Comment

by:chrisbolt
ID: 1840213
Also, martin, it is better not to use /yourdir/images if you move to a different server or you keep a copy of your pages on your own computer for offline viewing/editing.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now