Search the site:
(New search engine!!)

Problems with links in GoLive


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.

The most common problem is the link to the CSScriptLib.js file, this is the file that contains all your external JavaScript code. When the link is broken actions and rollovers don't work.

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:

  1. Start from the web page containing the reference.
  2. Go up one folder.
  3. Go into the "images" folder.
  4. 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:

file:///D:/MyDocuments/Sites/Ahgrens_folder/ Ahgrens/images/imgProducts/cemts.gif

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:

../images/imgProducts/cemts.gif

There are two ways you can make this "behind the scene work" break down:

  • You work on a page located outside the site folder.

  • You work on a page while the site file is closed.

In both cases GoLive will be unable to turn the absolute links pointing to your local machine into relative links.

  • In the first scenario because things happen outside the scope of the GoLive database.

  • In the second scenario because the database has been shut down.

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:

/images/imgProducts/cemts.gif

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:

www.mysite.com/images/imgProducts/cemts.gif

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.

I have used an image file in my examples, but this problem affects all types of files, media, external JavaScript files, etc...

Conclusion:

  • Never work on pages located outside the site folder.

  • Always work with the site file open.

How to fix the CSScriptLib.js link:

  1. Open your site file.
  2. Open the page with the problem link. Follow the steps below or use this video.
  3. Click the page looking icon in the upper right corner of your page window.
  4. In the Inspector click the "HTML" tab.
  5. Under "JavaScript functions" check "Write code into page".
  6. 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.

- Michael Ahgren