Solved

Assigning a variable for the web application's path

Posted on 2002-06-13
5
138 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

785 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