Solved

Assigning a variable for the web application's path

Posted on 2002-06-13
5
136 Views
Last Modified: 2010-04-09
How can I declare a path statement whereas  in my HTML I can just call the variable name instead of the path?  I have seen code like <a href = <%userpath%> & "whatever.htm"...... but don't know how to use it. I want to use it in multiple pages mainly so I do not have to keep changing my hardcoded paths in all my pages whenever I move something.
I am using Javascript in my pages too.
0
Comment
Question by:CCOIA
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:KenAdney
ID: 7075998
Well, I think you've got most of it, the part about  referring to the previously defined variable.  I think all you have to do is define what "userpath" is, for instance:

<%userpath = "../file_directory/" %>

put somewhere in the head of the ASP page.
0
 

Author Comment

by:CCOIA
ID: 7076175
That is my problem (should have elaborated more).  It is not an ASP page.  It is on a page that will be on an AS400 server running Webshere.  Can I still use the above syntax in a non-ASP page?
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 50 total points
ID: 7076222
That is strictly ASP syntax.  You can do it ins straight HTML by putting this in the head of the pages.

<base href="http://www.mysite.com/myfolder/index.html">
It will then treat everything up to the file name as the base path.  so a reference in the page like:

<a href="thepage.htm">  We be interrpreted as <a href="http://www.mysite.com/myfolder/thepage.htm">

and  <img src="images/my.gif"  will be >img src="http://www.mysite.com/myfolder/images/my.gif">

Cd&
0
 

Author Comment

by:CCOIA
ID: 7076250
Thanks, just what I was looking for.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7076468
Glad we could help.  Thanks for the A. :^)

Cd&
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
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…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

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

23 Experts available now in Live!

Get 1:1 Help Now