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...!
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.
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...
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.
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.
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'.
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.
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 7.0 | 49.63 % |
| 2 | Microsoft Internet Explorer 6.0 | 20.10 % |
| 3 | Firefox 2.0 | 14.71 % |
| 4 | Firefox 3.0 | 8.50 % |
| 5 | Safari 525 | 2.59 % |
| 6 | Opera 9.5 | 0.95 % |
| 7 | Safari 523 | 0.52 % |
| 8 | Opera 9.2 | 0.52 % |
| 9 | Firefox 1.5 | 0.44 % |
| 10 | Safari 312 | 0.33 % |
| 11 | Safari 413 | 0.25 % |
| 12 | Safari 419 | 0.25 % |
| 13 | Opera 8.0 | 0.19 % |
| 14 | Microsoft Internet Explorer 5.0 | 0.19 % |
| 15 | Firefox 1.0 | 0.16 % |
| 16 | Microsoft Internet Explorer 5.2 | 0.14 % |
| 17 | Microsoft Internet Explorer 4.0 | 0.14 % |
| 18 | Microsoft Internet Explorer 5.5 | 0.11 % |
| 19 | Firebat 2.7.13 | 0.05 % |
| 20 | Netscape 7.1 | 0.05 % |
| 21 | Safari 412 | 0.05 % |
| 22 | Netscape 7.2 | 0.05 % |
| 23 | Camino 1.0 | 0.03 % |
| 24 | Safari 417 | 0.03 % |
| 25 | Safari 85. | 0.03 % |
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.
I have added the
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!
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!
| Interested in learning more about JavaScript, CSS, HTML/XHTML/XML and PHP programming? I would highly recommend the following books... | ||
[ This page viewed 2509 times. Last viewed Sun 20 Jul, 2008 at 00:38 ]