JavaScrip Beginner Tips: What You Need To Know?
For starters, a few basics you need to know are:
No, I am not trying to scare you away with these points.
1. Understanding HTML5 Video
This little snippet will prevent your website from trying to display a video that the browser cannot support, saving you bandwidth and processing power.
This snippet is a little long but very useful, it will allow your site to store information on the viewer’s computer then read it at another point in time. This snippet can be used in many different ways to accomplish different tasks.
3. Preload your images
This snippet will prevent your site from having that awkward time when it is only displaying part of the site; this not only looks bad but is also unprofessional. All you have to do is add your images to the preloadImages section and you are ready to roll.
4. E-mail Validation
5. No Right-Click
This snippet will prevent the viewer from being able to right-click on your page. This can discourage the average user from borrow images or code from your site.
6. Display Random Quotes
Ok so this is not a snippet that all sites would use but it can be used to display more than just random quotes. You can change the content ok the quotes to whatever you want and have random images or text displayed anywhere on your site.
7. Previous/Next Links
This snippet is great if you have multiple pages on an article or tutorial. It will allow the user the browse between the pages with ease. It is also small and light weight from a resource point of view.
8. Bookmark a Page
This snippet will allow the user to bookmark your page with ease; all they have to do is click the link. Its little features like this that can increase your viewers overall experience.
9. Easy Print Page Link
This little link will allow your views to easily print your page. It utilizes the quick print feature already setup by your browser and utilizes no resources until it is clicked.
10. Show Formatted Date
This snippet will allow you to display the current date anywhere on your webpage and does not need to be updated. Simply put it in place and forget about it.
11. Comma Separator
This snippet would be used mainly by sites that use numbers often. This snippet will keep your numbers looking the same across the board. All you have to do is copy the body line where you want to add a number and replace the number there with your number.
12. Get the Display Area of a Browser
This snippet will allow you to get the width and height of the display area in your views browser. This will give the designer the ability to create and use different displays based on the size of the user’s browser window.
13. Redirect with Optional Delay
This snippet will allow you to redirect your viewers to another page and it has the option of setting a delay. The use of this snippet is pretty self-explanatory and it is a very valuable tool to have in your belt.
14. Detect iPhones
This snippet will allow you to detect if your viewer is on an iPhone or iPod allowing you to display different content to them. This snippet is invaluable with how large the mobile market is and it is only going to continue to grow.
15. Print Message to Status Bar
This little snippet will allow you to print a message to the status bar. You can display recent or important news in an area the will catch the eye of the user.