Scroll up and down div from input buttons in JavaScript

If you want to scroll up and down the div element through the buttons you can use the following code sample.

The example contains a div element and two input buttons for up and down scroll. In this example the div element contain an image. You can get an idea from the below image. Continue reading “Scroll up and down div from input buttons in JavaScript”

How to create and read cookies in JavaScript

The cookies are the small bit of the text data that can be stored in the user’s browser so that it can be reuse in the next request. Generally web server instruct to write the cookie on the user’ browser. But you can also manipulate the cookies using JavaScript. You can create, delete, modify and read using the Document.cookie property. Continue reading “How to create and read cookies in JavaScript”

How to prevent your javaScript code from syntax errors

The Syntax error in the JavaScript code is very common error type when your write the code. Generally when you write the wrong structure of the JavaScript code , browser will give the syntax error at the time of interpretation. Small syntax error in the JavaScript code on a Web page can stop the script from working correctly. Continue reading “How to prevent your javaScript code from syntax errors”

How to detect the support of HTML 5 features on user’s browser

Basically Modernizr is an open-source JavaScript library that detects the support of native implementations of HTML5 and CSS3.

First time I saw the use of the Modernizr JavaScript library in my first MVC4 web application in the BundleConfig.cs file. I had started the MVC4 with the internet template. At that time I don’t know the real use of this library, later than I found that it can be very useful to take advantage of the advanced feature of the HTML5 and CSS3. Continue reading “How to detect the support of HTML 5 features on user’s browser”