Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible solution to "why does JS double up path names

Status
Not open for further replies.

MikeCou

Technical User
Apr 23, 2009
10
I posted an earlier message called "Why does my JS script double up on path names?". It's about 6 or so posts below this one (the actual code is in there). I got some good answers and some personal opinions but I think my minimal knowlwedge of Javascript may have hampered my understanding of the answers because I still can't make this work.

In the meantime, the brain never sleeps, I thought of 2 ways that a solution may be worked but I don't know if they are doable in JS.

Possible solution 1: Is it possible to add an unload() event at the bottom of each HTML page that would reset the path for further selections to ./ for example?

Possible solution 2: Is it possible to incorporate an if...else statement right in the js script that would state that:
if selection = filename.html or otherfilename.html
then set path to (whatever the path is)
else
set path to ./
endif

I know this is very coarse and simplistic. I only have 3 types of files on the site that require a different path, all others are files directly in the root folder for which ./ should work fine. It's just the 3 other types that are giving me a double up on the path names.

Right now, I've got 2 Javascript books on my lap, I've downloaded tons of samples to analyze, guzzled gallons of crappy coffee, tried some experimenting and created a few "frankensteins" and I'm really stymied. To me, the problem seems so small and in my logical human mind, the solution must be so easy! I'm obviously not a JS programmer. I've done some DBase stuff in the past, I'm pretty good at HTML and getting better at CSS but Javascript is still a ways off! I'm not giving up but I would like this site up and running so I can return to learning more about JS.

The actual site is up and running at right now but the coding of the js file uses actual path names, including the "http:// etc". It's clunky and hard to understand. I'm trying to make it neat and organized with folders, subfolders, etc for the future web guy who'll take over when I retire. Dumping all the files in the root folder seems very disorganized to me although it does solve the problem of the double up path names.

Thanks all
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top