Solved

Simple simple simple

Posted on 1998-12-04
5
131 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

776 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