Solved

Simple simple simple

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
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…
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…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

757 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

17 Experts available now in Live!

Get 1:1 Help Now