Frequently Asked Questions (FAQ)

Before you try sending me an e-mail, a lot of the e-mails I receive ask very similar questions. It might save you a lot of time to have a read of these answers...!

  1. It works when I test it but not when I upload it?
  2. I already have scripts on my page and when I add yours they all stop working?
  3. When I run the script I get the word 'null' or 'undefined' appearing?
  4. Can you change the script to do something a bit different?
  5. It doesn't work... What do I do?
  6. Why don't you support Netscape or Internet Explorer versions 4 or less?
  7. What exactly is DHTML?
  8. What does 'XML Compliant' mean?
  9. What difference does 'XML Compliant' make?

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.

Why don't you support Netscape or Internet Explorer versions 4 or less?

All the scripts on my site rely on using the Document Object Model (DOM). This feature was not available in browsers of version 4 or less and so my scripts will not work in these early browsers. However, the statistics from my web-site show that less than 1% of the total people who visit still use these ancient browsers, so I do not feel particularly bad about excluding them (they should get an upgrade anyway, it's not as if you have to pay for one!) Here are the actual statistics for the top 25 browsers that visit this site with version 4 browsers shown in yellow:

Rank Browser Visitors
1 Microsoft Internet Explorer 8.0 34.66 %
2 Firefox 3.6 20.87 %
3 Microsoft Internet Explorer 7.0 12.27 %
4 Chrome 5.0 8.90 %
5 Firefox 3.5 3.98 %
6 Safari 533 3.72 %
7 Microsoft Internet Explorer 6.0 3.51 %
8 Safari 531 2.27 %
9 Safari 528 2.03 %
10 Firefox 3.0 1.83 %
11 Opera 9.8 1.49 %
12 Safari 653 1.28 %
13 Safari 525 0.76 %
14 Safari 530 0.56 %
15 Firefox 2.0 0.37 %
16 Safari 413 0.31 %
17 Gecko 1.9 0.22 %
18 Opera 9.6 0.22 %
19 Opera 9.5 0.19 %
20 Safari 523 0.11 %
21 Chrome 6.0 0.11 %
22 Firefox 4.0 0.09 %
23 Opera 9.2 0.09 %
24 Microsoft Internet Explorer 5.5 0.09 %
25 Chrome 4.1 0.08 %

What exactly is DHTML?

DHTML uses a combination of JavaScript (occasionally, but not often, referred to as ECMA-Script) which is a computer language that your brower can understand and Cascading Style Sheets (CSS), which is a way of changing the style of a given part of a web-page. DHTML scripts typically animate a piece of text or some graphics by changing elements of the style associated with it, such as it's colour, size, location or visibility. As such, DHTML is just a JavaScript programme, hence the reason that the two are often connected.

Just to confuse matters further, there is another language that your browser can understand called Java. Java is much more sophisticated than JavaScript and can produce some stunning visual effects.

What does 'XML Compliant' mean?

I have added the xml compliant logo to all the scripts and effects on my pages which work when served with mime type 'application/xhtml+xml'. This means that if you are writing your web-pages in XHTML instead of HTML and serving up these pages as proper XML, the scripts will still work fine. If you have no idea what this means, don't worry, it just means that all those scripts with the logo are compatible with the latest web-page authoring standards - they will work just as well on any web-page!

What difference does 'XML Compliant' make?

To make scripts work properly when served as XML (application/xhtml+xml) a number of changes need to take place. By far the largest change is that the JavaScript function 'document.write' does not work. In some browsers (Firefox 1.0 for example) the 'innerHTML' property is read-only meaning that you can not use this function to modify the page either. Hence any modifications to the page need to be done using the W3C Document Object Model (DOM) which makes some scripts a little more complicated (and whilst in theory makes cross-browser support easier, it still throws up lots of problems).

One other change that needs to take place is that the code within the '<script>' tags needs to be enclosed in the proper XML comment tags '<![CDATA[' and ']]>' instead of the HTML comment tags '<!--' and '-->', otherwise the browser will ignore the code altogether. Whilst using the XML tags may cause problems to some very early browsers, even good old Netscape 4 can cope with them without causing a problem and hence the change is (give or take) fully backwards compatible.

No menu on the left? Click here for a full list of all the free DHTML and Javascript effects you could be using on your web-site!

If you like my Text and Graphic Effects,
please rate them @ ScriptSearch.com!
 

[ This page viewed 69 times. Last viewed Fri 30 Jul, 2010 at 12:39 ]