Website Building: With Javascript

Website Building: With Javascript
Add more interactivity to your site 01. Copyright Copyright section usually consists of five (such as © 2003 by The Company) but what happens when the year changes? It's noteworthy that many webmasters are not always up to date and that makes your site obsolete. Please use the following JavaScript to fill in the copyright section of your site: <scriptlanguage="javascript"> document.write (new Date ()) getFullYear ()); 02. Swap image file There are many reasons for wanting to swap photos on your site, but the most common case is when you want to create an online gallery. There are several classic ways to do this, including creating a new page for each full-size image or using a pop-up window. The first way to make you feel discouraged when the design and the use of pop-up windows are often blocked by anti-pop-ups. Use JavaScript to design an attractive online photo gallery that you can easily edit, experiment and extend. Illustrative examples can be found in the accompanying CD (image_swapper.html file). 03. Randomize the content Having a few random content on your homepage is a good idea. It impresses that your website is constantly updated and that it also makes it possible for you to bring a new face to your website to your customers, such as displaying random files. graphics. Similarly, random text fragments can also be used, such as a collection of quotations or quotations. You can find out more about the examples on the CD (random_content.html file). 04. Use the slash () If using JavaScript, you will probably have to use the "and" characters in your command lines, such as when using the document.write command to display the attributes of the command. These characters can affect command strings (or the entire script). To avoid this, you can add the slash () characters before the characters, such as width = "300" instead of width = "300". You can also apply the same with the slash (/) character. This little trick will not affect your command sequence or code. 05. Stay away from the advertising tricks On the Internet there are hundreds of websites that allow you to "Cut and Paste" scripts and often these sites are very attractive to everyone. However, just shake hands with them if you really feel secure. Stay away from annoying ads, such as those that use JavaScript to pop up "hello" or "goodbye" pop-ups. It's even worse if they turn off your mouse right-click function and make your PC use uncomfortable and difficult. 06. Offer alternative solutions Except for art or experiment sites, limit JavaScript to effects or features of web pages without providing a non-JavaScript version instead. Surprisingly, a very large percentage of users surf the web with their browsers turned off JavaScript, and if that happens to your site, a JavaScript-based web site means customers. inaccessible. 07. Create other faces When creating web pages, even with dynamic or static pages, designers need to test their results on a variety of screen resolutions. Changing resolutions may take some time and may cause the display to fail. So, you can use JavaScript snippets to resize the browser window. Type the following code in a text editor: Javascript: moveTo (0,0); window.resizeTo (800,600). Select this code and drop it into your browser toolbar, rename it to 800x600. When you click on this item, your browser toolbar will resize itself. You can create the same code for different resolutions or for your own individual settings. See http://www.favelets.com for more details. 08. Code scripts available There are thousands of scripts on the web that you can use, which will save you a lot of time writing them down. One of the most popular source code is javascript.internet.com. However, you need to keep in mind two things: 1) most code snippets are copyrighted, so please download the copyright details if the author asks to do so; 2) Not all scripts are compatible with all browsers. 09. Display and mark the contents The consistent adoption of the standard Document Object Model with both Internet Explorer 5, Netscape 6 and Opera 7 makes some complicated web design tricks ever simple, including displaying and marking page contents. web. You can find the example in the CD (show_and_hide.html). Creating a display content area consists of two steps. First, we have to create a link, used to switch display / seal mode: Click me! Pay attention to "swap ('hello')". Hello is the value id assigned to the variable to be converted. Next we create the variable: Note that this variable has an id attribute with a value of "hello" and a format attribute that specifies the default display mode as "none". Visit http://www.snubcommunications.com/iceland to find examples of this code used in online photo galleries.