Maintaining relationship of the variables in JavaScript using ConstraintJS. Continue reading “Maintaining relationship of the variables in JavaScript using ConstraintJS”
Tag: JavaScript
JavaScript is the dynamic client side scripting language. It is most commonly used as part of web browsers. JavaScript is a prototype-based scripting language with dynamic typing and has first-class functions. You can alter the document content and can access any element of the DOM document. JavaScript is almost entirely object-based.
See the small example of the JavaScript:
...
function changeText() {
var txt = document.getElementById('btnclick').value;
if (txt == 'Show Image') {
document.getElementById('btnclick').value = 'Hide';
}
else if (txt == 'Hide Image') {
document.getElementById('btnclick').value = 'Show';
}
}
...
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”
Make full select the text on the single click in text area
The following code sample can be used for to select the all text word in the single click. Continue reading “Make full select the text on the single click in text area”
Code snippet: Remove button element on the click event of itself using JavaScript
If you need to use the button to remove it self, you can use the following code. Continue reading “Code snippet: Remove button element on the click event of itself using JavaScript”
Client side validation on asp.net File upload control using JavaScript : For the file type
The following article shows that how to validate the type of the file that is selected to upload by the user. Continue reading “Client side validation on asp.net File upload control using JavaScript : For the file type”
Code snippet: Bind the select elements for the month numbers and years in JavaScript
In the following code snippets you’ll see that how to bind the month numbers 1 to 12 and year range into the select elements at run time using JavaScript. Continue reading “Code snippet: Bind the select elements for the month numbers and years 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 know whether string contains special characters or not in JavaScript
In this section I will show you that how we can use the simple regular expression to know whether the specified string contains the special characters or not. Continue reading “How to know whether string contains special characters or not in JavaScript”
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”