

|
Web Sites With Publisher |

|
A.Webster Feb 2005 |
|
Websters on the Web |

|
Creating JavaScript Buttons Javascript code snippets are widely published on the Internet and are compatible with all modern browsers so why not use them? Javascript code can be added to your publisher web site by using the "HTML code fragment" button (or Insert, HTML code fragment on the menu. Code for a button to open this page looks like this: <SCRIPT language='javascript'> </SCRIPT> <FORM> <INPUT type="button" value="JavaScript buttons" name="button1" onClick="window.location='javascript.html'"> </FORM> (note that splitting the code over more than one line here is for readability only, your code shouldn't contain carriage returns) value = button text, javascript.html is the page to load, each button on a page needs a different name (this one is button 1). Testing Of course Publisher displays this as code rather than a button. You will need to do a web page preview to see a button. Even then the button may not link to the correct page when you run the site so you really need to use File, Save as HTML (Save as Web Page in Publisher 2000) to test it. Still, if you are happy to do this then you will be able to source JavaScript for rollover buttons, marquees and all sorts of other things too. Beware though, user defined functions need to go in the <Head> section of the page which you don't have access to from Publisher. Maybe if this is your cup of tea you should be using a more advanced web design program? |