Solved

Simple simple simple

Posted on 1998-12-04
5
133 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

729 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