Collection Of Important JavaScript Codes

Javascript code snippetJavaScript is the client side scripting language that can be used for making website interactive. In this post, I am adding few JavaScript codes that can be useful for you. These codes can work in all kind of website and content management systems (including blogger, WordPress).

Default Home Page – A JavaScript Code

If you want users to give an easy way to set your website as homepage, you can use the following javascript code.

Bookmark – A JavaScript Code

Although, all browsers support one click book mark to any website, you can give an additional link on your website to bookmark your website. Just use this simple code and allow users to bookmark your website just by clicking a link.

No-Right Click Javascript

Sometimes we want to disable right click function on our website to protecte images and content. For this, we can use this code.

Random Image Generator

If you want to display a random image each time a page loads, you can do it with JavaScript. Just use this simple code.

Counting words entered in a text box

Sometimes we need to count words entered in the textarea. We also want this to be real-time counting and numbers should increase as typing in the text area would go on. See how it can be done

Form.  This is the code of the form. having a text area and a text field. Text field will show the count of chars

JavaScript function

Anti select script

This Javascript code is very useful for blog owners and web master to protect the content of their website from being copied and reproduced again.

These are simple code snippet that can be used in blogger and WordPress as well. Although you may use jQuery to implement these things with beautiful effects. But for simple working code, use these.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest updates, web design resources and tools.

You have Successfully Subscribed!

About The Author

  • ADD YOUR COMMENT

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!

Pin It on Pinterest

Share This

Share This

Share this post with your friends!