Javascript Archive

Javascript Code to Scrolling Page Title

Here I am going to share the Javascript code for scrolling the page title of any web page. You can change the page title by simply set document title property using javascript [crayon-57732b0e9d474541735502/] Scrolling Page Title Code [crayon-57732b0e9d47c049838336/] You can change the scroll speed by changing the value of variable “speed”. Above it is 150,

Create Interactive Charts with Google Chart API

Last post, we have discussed about Create image charts using Google Chart Tool. Here, we are going talk about how to create interactive charts using Google chart API. Google’s Javascript library allow you to create the charts and throws the events which can be handled by your code. Interactive charts and diagrams will give the

Change Font Size with JavaScript

Here is the javascript code to increase or decrease the font size on the fly, you can give control to the user to change the text size for better readability. function resizeFont(multiply) { var sz = document.body.style.fontSize; if (sz =='') sz = 14; //default font size var size = parseFloat(sz) + (multiply * 0.2) +

Create, Read and Delete Cookies with JavaScript

In this tutorial, I am going to give a JavaScript code samples to create, read and delete the cookies. Setting a Cookie function SetCookie(name,value,days) { var now= new Date(); var expDate = new Date(); if (days==null || days==0) days=1; //create date after no of "days" from now expDate.setTime(now.getTime() + 3600000*24*days); //create cookie with name, value

How To Get Url Parameters Using Javascript

Here, I am going to share Javascript code to get the URL querystring parameter values. Let me take a sample URL and try to get the parameter values in it. [crayon-57732b0e9e021096656948/] Here is the function to create the Javascript object with parameter names and values. [crayon-57732b0e9e028693503804/] In the above code, “window.location.search” is to get the

How to Refresh/Reload Page or Part of the Page Automatically

Here I am going to show different methods to refresh/reload the page or part of the page automatically in certain period of time. Simplest way to refresh whole page is by using meta tag as below: [crayon-57732b0e9e548180039213/] Above code refreshes the page for every 30 seconds. if you don’t want to use meta tag as

Print a Part of Page using Javascript

do you want to print a part of the web page? do you have multiple print buttons in a web page, which prints portion of the page? do you want to exclude some elements in print of your page? (like images, ads) do you want to print the display page differently? (changing font or colors
Bitnami