Small Javascript trick
Posted: Thu Jan 27, 2005 5:23 pm
My site is up and being played with and I just threw together a minor little Javascript trick that's a help. You know that every link or image URL in a Keenspace page has to have the "/" on the front? That means that unless you have your website stored in the root directory of you harddrive, all the links will be broken when you're working on your pages and templates at home.
This'll make the pages work on both Keenspace and your harddrive all the time. It goes in the HEAD section of your webpage.
Unfortunatly, it has to be the whole "http://yoursitehere.keenspace.com/" rather than just "/" or else IE gets messed up.
- Joel Fagin
This'll make the pages work on both Keenspace and your harddrive all the time. It goes in the HEAD section of your webpage.
Code: Select all
<script type="text/javascript">
<!--
if (!(document.URL).match("indextemplate"))
document.write("<BASE HREF='http://yoursitehere.keenspace.com/'>");
//-->
</script>
<NOSCRIPT><BASE HREF='http://yoursitehere.keenspace.com/'></NOSCRIPT>
- Joel Fagin