This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
adding things from diff sites

I been try to add different effects to my webpage. but it doesn't work. From this site. www.dynamicdrive.com i done it right and still doesnt work.

Re: adding things from diff sites

more detail please, like things are you using from that site?

Re: adding things from diff sites

To make any Javascript work properly in the Website Wizard takes work. Some of the problems are caused by poorly distributed code, and others by the Wizard.

The code from places like DynamicDrive always want you to just copy/paste it into you site. That usually included comment lines that have their name or other information about the script. If they use a HTML comment, , or Javascript comment, /* and */, it's usually OK. But if they ever use the Javascript comment "//", your doomed. This is because the Wizard strips out all return characters and the "//" type comment depends on the return character to terminate the comment. Without return characters, all you have is one big comment.

Removal of all the return characters also means that all of the Javascript lines must have perfect syntax. The code for the military clock, for example, has three syntax errors. Two of which will disable the code, if all the return characters are removed.

I will give you initially, a very simple example of making one of the scripts on your site work. On your front page, in the side bar on the left you have a date and time script. The code looks like this:



To make the date work, remove the two highlighted lines, and paste it back into your content area. Yes, I know that those lines are to hide the script from older browser, but you either want it to work, or not.

The Military Date script can also be made to work, but needs to be approched differently. A Javascript "OR" function is signified by "||", but alas, the Wizard also strips those out too, rendering the code useless. For this script, like many others, you have to remove the Javascript and put it in a file. Then source it from your web page. I have a web page where I started to explain how to make the Military Time script work with the Wizard. It's at Military Time Script. I'll finish up the explanation today. Check back on it later.

Re: Re: adding things from diff sites

Those highlighted lines hide it from extremely ancient version one browsers, modern browsers processing XHTML and cause many wmodern web editors to dump the content as a comment. You should ALWAYS remove those lines from any script that you get because if the lines have any effect at all it will be to stop the script working for some or all of your visitors.

The other thing to note with at least some of the scripts from places such as Dynamic Drive is that there are lots of scripts there that were written for version 4 browsers (IE4 and Netscape 4). Many of these scripts will not work properly with the latest version 8 and version 9 browsers. If the script references document.all or document.layers then you will know that it was written for version 4 browsers since all version 5 browsers use document.getElementById.