Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Assigning a variable for the web application's path

Posted on 2002-06-13
5
Medium Priority
?
144 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
[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
 
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 200 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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)
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…

722 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