Baxter Family History Sirname Index    


 First Prayer in Congress
 BACK, All My Baxter Links!
  Baxter Links Page 2

Trouble with Scripts

credit goes to click here for more scripts and info

It works when I test it but not when I upload it?

Many web-hosts (especially the free ones such as 'geocities', 'lycos' and 'xanga') insert their own JavaScript into a page after you have uploaded it, for example, to launch pop-ups when the page loads, or to show adverts. These scripts mess up any other scripts such as mine, that you might have added. Sadly, there is no simple solution other than moving your site to a better host.

I already have scripts on my page and when I add yours they all stop working?

A lot of scripts (mine included) rely on a thing called an 'onload' event handler. This starts the script running once the page is loaded. Unfortunately, only one onload handler can work at a time on any page; if you have more than one, then none of them work!

To see if you have more than one, search your HTML code for the keyword 'onload'. This appears in my scripts as the term 'window.onload=function() {' but may also appear in the <body> tag in the form '<body onload="NAME_OF_FUNCTION()">', where NAME_OF_FUNCTION is the name of a script. If you have more than one instance of the onload handler, there is a solution...

  1. Convert all of the instances where the handler appears as 'window.onload=function() {' to the form 'function NAME_OF_FUNCTION() {' where NAME_OF_FUNCTION is a unique name for that function, for example 'function matrix() {', and note down the name of the function (in this case 'matrix').
  2. Where the handler appears as 'window.onload=NAME_OF_FUNCTION', note down the name of the function and delete the line.
  3. Where the handler appears as 'onload="NAME_OF_FUNCTION()"', note down the name of the function and delete the 'onload="..."' part.
  4. In the <body> tag, add 'onload="NAME_OF_FUNCTION(); NAME_OF_FUNCTION(); NAME_OF_FUNCTION()"' replacing NAME_OF_FUNCTION with the name of each of the functions you have noted.

That's it! When you load the page, all the scripts should now run. I say 'should' because if any of the scripts use the same variable names, then there may be other problems that stop one or other functions running. If you can't follow the instructions above then there's little chance of me being able to help you further - adding scripts to your page does, I'm afraid, require a certain amount of knowledge and expertise.

When I run the script I get the word 'null' or 'undefined' appearing?

Each of my DHTML text effects (but not the graphics effects) requires you to add a '<span>' or '<div>' tag into the body of your HTML page. Inside these tags should be the text you want animating and nothing else. Adding links or images will cause the scripts to stop working and forgetting to put the tags on your page in the first place can be equally disasterous.

Can you change the script to do something a bit different?

If I had to re-write the scripts each time someone wanted them to do something a bit different, I would never get any other work done. By all means drop me a line if you have a good idea for an improvement or for a new script that you would like to see, but don't be offended if the answer is 'no'.

It doesn't work... What do I do?

You wouldn't believe how many times I get asked this question. And the simple answer is "Without more information, I have no idea!" If you are having a problem getting a script to work, and even with the help of these FAQs you still can't get it going, at least send me a link to the page where the problem is, otherwise you might as well be asking "How long is a piece of string?" for all the assistance I can be.