Java Script Button Snippets


22 September, 2012   

Allows you to take a user to the previous page they were on using a button

You may create a back button like your browser has. The following script allows the visitor to press a button and returns the him to the previous page.

06 November, 2013   

Example shows how to handle window closing events. This is a very basic event handling when you are working on a UI Application.

09 November, 2013   

Just like your browser's back button, the following script allows the user to press a button to returns the user to the previous page. Paste the following code where you want the button to appear on your page:

19 December, 2012   

Example shown here how to convert String to Date in Java

09 July, 2013   

Copy selected text by allowing user to simply click a button

13 August, 2011   

Although there really isn't any foolproof way to protect your web page content, this JavaScript will discourage the more novice Internet users from copying your content. An alert box will appear displaying your copyright information when the right mouse button is clicked. However, this script will not completely protect your content from more...

17 April, 2013   

In Firefox, Safari and Chrome, this script only works if the window was originally opened using Javascript (window.open function)

05 January, 2013   

You can use carriage return characters to break the line: & # x 0 0 A ;

Sometimes you have some information on your page and your visitors might want to copy it. The easiest way is to provide a mechanism that allows them to simply click a button to do so. You have to paste this code into the head of your web page:

Java code example showing here how to send HTTP request & fetching data

26 July, 2012   

Java code example to append text to file in Java

19 December, 2012   

How to convert a java util Date into a sql Date for use in databases.

Scribble an applet of intermediate complexity, used as an example in the introductory chapter. Click and scribble in the window.

12 January, 2011   

Browsers already have "back" buttons, so you'd better have a darn good reason for needing to put one on your page! This is totally obtrusive, but you could fix that by only appending this button through JavaScript.

JavaScript Code example to protect Your Web Page Content

10 April, 2012   

Protect your web page content with JavaScript code

23 February, 2013   

Some super-simple rules to kick out automated script.

Jave code for PDF Generation using iText JAR

Place the following JavaScript code into your HTML where you would like the button to appear: