Breaking News
Home / Web / Javascript


How to create 2D Canvas in HTML5 using Javascript?

Snippet The following snippet shows how to create a div called as canvas (can be any name) and then in javascript we get the handle to canvas by calling document.getElementById method. Finally we get the 2D context from the same. Once the context is obtained, using javascript commands we can …

Read More »

How to enable Javascript in Internet Explorer 8.0?

Depending on security settings Javascript could be disabled in Internet Explorer. This screencast shows how to enable Javascript for the same.   Steps In oder to enable JavaScript in IE, perform the following the steps:   1. From the Tools menu, or the Tools drop-down in the upper right, choose …

Read More »

What is YUI Library?

<!–?xml version=”1.0″ encoding=”UTF-8″?–> The YUI Library is a set of utilities and controls, written with JavaScript and CSS, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. YUI is available under a BSD license and is free for all uses. YUI is proven, scalable, fast, and robust. Built by front …

Read More »

How to get video id from a Youtube url in Javascript?

Snippet e.g. if the youtube, video url is: The snippet will return xptDCPlSSfI var url = “”; var video_id = url.split(‘v=’)[1]; var ampersandPosition = video_id.indexOf(‘&’); if(ampersandPosition != -1) { video_id = video_id.substring(0, ampersandPosition); } [pb_builder]

Read More »

How to redirect page to another url using Javascript?

Sometimes we have to redirect a page to another location. This can be achieved by using Javascript window.location method in the HTML page  using the following snippet. This script can be added anywhere on the page, however as a best practice it should be added at the beginning of the …

Read More »
Advertisment ad adsense adlogger