internal links

admin

Administrator
Staff member
Hey all.. I'm not sure how to word this question... so I'll probably go all the way around the block to get across the street (so to speak)<br />
<br />
I have a html document that refers to a .txt file. The txt file should be loaded into the html document thru javascript. here's the code.....<br />
<br />
<SCRIPT LANGUAGE="JavaScript" type="text/javascript" src=http://www.htmlforums.com/archive/index.php/"title.txt"></SCRIPT> <br />
<br />
The problem is that the "title.txt" file is not in the same directory... and is in one level UP from the directory the html file is in. <br />
<br />
the Question... it should be simple, but for some reason I can't get it to work..... "how do I point the 'src=http://www.htmlforums.com/archive/index.php/"title.txt"' to the next level up?<br />
<br />
Is that clear as mud or what??? lol<br />
<br />
Thanks<br />
Wildlife<!--content-->change 'src=http://www.htmlforums.com/archive/index.php/"title.txt"' to src=http://www.htmlforums.com/archive/index.php/"../title.js"<br />
<br />
if its javascript the file should be saved as a .js file <br />
<br />
hope this helps:D<!--content-->Much appreciated...<br />
<br />
I had tried the ../<br />
<br />
come to find out I had a configuration problem... so I had it right in the first place and the problem was elsewhere...<br />
<br />
I realize that .js should be the extension for javascript, but the .txt files seem to work just fine. What is the difference? and can problems arise?<br />
<br />
Thanks again!<!--content-->yeah it will probably work with the text file too<br />
<br />
i learned a little javascript a few years ago (still got the book) and it taught me to always save the files as js and ive always have since then<br />
<br />
habit i guess:D :)<!--content-->thanks a bunch<br />
<br />
this is my first go at coding javascript myself... albeit a VERY simple script... just trying to do a "page include" still having some minor difficulties... because the .txt file is up one level from the html doc I want to include it in... the text & links show up fine, but it doesn't bring the images along from "up one level"<br />
<br />
hmmm interesting<!--content-->let me have a look at the code and ill try my best to see whats wrong<br />
<br />
remember the images folder have to be linked to in relation to where the javascript text file is so you might have to add a ../ before them too :) :D<!--content-->Thanks...<br />
<br />
the javascript txt file is in the same directory as the images...<br />
<br />
if ya go to my site... the title and logo on the top as well as the flag and football in the lower left work fine.. but if you click on the more links in the "blog", the links and text come up, but not the images...<br />
<br />
I'm in the middle of a complete rebuild with lots of work to do yet... so be nice....:D<!--content-->firstly id get into the habit of putting all site images into a folder called images or something<br />
<br />
it doesnt matter much now but when your site grows it will save you a lot of effort ;)<br />
<br />
using your main logo as an example<br />
<br />
your main logo is saved at <!-- m --><a class="postlink" href="http://www.thatcomputerguy.us/banner.gif">http://www.thatcomputerguy.us/banner.gif</a><!-- m --> <br />
<br />
and this is where the image is linked to in the home page and all main sections (eg. contact.html) and is why they all work fine as they are in the same directory<br />
<br />
the archives section however is a level down which is why it isnt showing<br />
<br />
i think i know where the problem is though<br />
<br />
the link to your style sheet in the archives section is <br />
<br />
<link rel="stylesheet" href=http://www.htmlforums.com/archive/index.php/"http://www.thatcomputerguy.us//styles-site.css" type="text/css" /><br />
<br />
notice the // after your domain name, make it one slash and see if it works :D<!--content-->well... changing the // didn't make any difference...<br />
<br />
I just wish I had 2 days to make changes.. lol I've been working on a re-build most of today... just not enough time...<br />
<br />
I will work on putting all images in a separate folder and then pointing to them... things are all garbled up right now because I still have a lot of the old files remaining on the web server...<br />
<br />
how many hours are there in the day??? LOL<br />
<br />
Thanks again.. I really appreciate your help!<!--content-->ill pm you:D<!--content-->Most spiders, mainly google I worry about, does not read javascript and sending them off to get a .txt file with a nasty surprise is not my idea of climbing high up in the search engine listing...do yourself and the robots a favor and name your js files .js...<br />
<br />
just thought I would add my 2 cents worth:D <br />
<br />
<br />
Ann<!--content-->Much thanks Ann<br />
<br />
I had to resort the entire file structure anyway, so I renamed the .txt files .js files early this morning...<br />
<br />
Thanks again!<!--content-->
 
Back
Top