This problem has one very sneaky aspect, you can't see it! You can upload the page and everything will work as expected. The references to your local HD will work, as long as you use the same machine for design and testing.
If you use another machine, or another person visits the page, all links will be broken since the referenced files don't exists on any of those computers.
Let's first take a look at relative links. "Relative" means relative to the page. So, a link that looks like this
../images/spacer.gif tells the web server to:
- Start from the web page containing the reference.
- Go up one folder.
- Go into the "images" folder.
- Get the image "spacer.gif".
When you start a new page in GoLive it's impossible for the application to guess where the page will be stored/saved. If GoLive doesn’t know the page location how can it create the relative link? The simple answer is - it can't.
Since there is no way to build a relative link GoLive has to use the only way there is to reference the file and that is to create a reference pointing to your local HD. Here is an example of this type of link:
As soon as you save the page GoLive will know the location of the page and it can start building relative references.
The references to your local HD are now removed and the relative references replace them. Here is an example of a relative link:
There are two ways you can make this "behind the scene work" break down:
In both cases GoLive will be unable to turn the absolute links pointing to your local machine into relative links.
If you, for some reason, are forced to work without a site file there are two ways you can avoid having links pointing to your local machine.
You can reference the file by using an absolute link, like this:
This tells the server to start in the root folder and then to go to the folder "images", etc... The drawback is that the link won't work until the page has been saved.
The other way is to make an absolut reference like this:
The drawback with this method is that the link won't work unless the file has been uploaded to the web server you are referencing.
How to fix the CSScriptLib.js link:
- Open your site file.
- Open the page with the problem link. Follow the steps below or use this video.
- Click the page looking icon in the upper right corner of your page window.
- In the Inspector click the "HTML" tab.
- You can now either leave it set to "Write code into page" or you can change the setting back to "Import GoLive Script Library" which will correct the link problem.