Skip to main content

Posts

HTML template using bootstrap

With a brief intro into the contents out of the way, we can focus on putting Bootstrap to use. To do that, we'll utilize a basic HTML template that includes everything we mentioned in the File structure . Now, here's a look at a  typical HTML file : <!DOCTYPE html> <html> <head> <title> Bootstrap 101 Template </title> <meta name = "viewport" content = "width=device-width, initial-scale=1.0" > </head> <body> <h1> Hello, world! </h1> <script src = "http://code.jquery.com/jquery.js" ></script> </body> </html> To make this  a Bootstrapped template , just include the appropriate CSS and JS files: <!DOCTYPE html> <html> <head> <title> Bootstrap 101 Template </title> <meta name = "viewport" content = "width=device-width, initial-scale=1.0" > <!--

HTTP Status Code 501 - Not Implemented

501 Error Code Explained The server either does not recognise the request method, or it lacks the ability to fulfill the request. Why it occurs The error occurs when the Web server does not understand or does not support the HTTP method it finds in the HTTP data stream sent to it by the client. The method in the request HTTP data stream should be one of the following GET, OPTIONS, HEAD, POST, PUT, DELETE, TRACE and CONNECT as defined by the HTTP protocol Or the method may be valid but not actually supported by the Web server. Fixing 501 error code The client should specify a valid request type. Even after that if the Web server is responding incorrectly, then the web server simply needs to be upgraded to fix the issue. If you are registered with 100pulse, your site will be monitored and you will be intimated by an email or a short message service when 501 status code error occurs.

Ajax Database

To clearly illustrate how easy it is to access information from a database using Ajax, we are going to build MySQL queries on the fly and display the results on "ajax.html". But before we proceed, lets do ground work. Create a table using the following command. NOTE: We are asuing you have sufficient privilege to perform following MySQL operations CREATE TABLE `ajax_example` ( `name` varchar(50) NOT NULL, `age` int(11) NOT NULL, `sex` varchar(1) NOT NULL, `wpm` int(11) NOT NULL, PRIMARY KEY (`name`) ) Now dump the following data into this table using the following SQL statements INSERT INTO `ajax_example` VALUES ('Jerry', 120, 'm', 20); INSERT INTO `ajax_example` VALUES ('Regis', 75, 'm', 44); INSERT INTO `ajax_example` VALUES ('Frank', 45, 'm', 87); INSERT INTO `ajax_example` VALUES ('Jill', 22, 'f', 72); INSERT INTO `ajax_example` VALUES ('Tracy', 27, 'f', 0); INSERT INTO

Image Map in javascript

You can use JavaScript to create client side image map. Client side image maps are enabled by the usemap attribute for the <img /> tag and defined by special <map> and <area> extension tags. The image that is going to form the map is inserted into the page using the <img /> element as normal, except it carries an extra attribute called usemap. The value of the usemap attribute is the value of the name attribute on the <map> element, which you are about to meet, preceded by a pound or hash sign. The <map> element actually creates the map for the image and usually follows directly after the <img /> element. It acts as a container for the <area /> elements that actually define the clickable hotspots. The <map> element carries only one attribute, the name attribute, which is the name that identifies the map. This is how the <img /> element knows which <map> element to use. The <area> element specifie

Redirect a page in javascript

What is page redirection ? When you click a URL to reach to a page X but internally you are directed to another page Y that simply happens because of page re-direction. This concept is different from JavaScript Page Refresh. There could be various reasons why you would like to redirect from original page. I'm listing down few of the reasons: You did not like the name of your domain and you are moving to a new one. Same time you want to direct your all visitors to new site. In such case you can maintain your old domain but put a single page with a page re-direction so that your all old domain visitors can come to your new domain. You have build-up various pages based on browser versions or their names or may be based on different countries, then instead of using your server side page redirection you can use client side page redirection to land your users on appropriate page. The Search Engines may have already indexed your pages. But while moving to another domai

Print a page in javascript

Many times you would like to give a button at your webpage to print out the content of that web page via an actual printer. JavaScript helps you to implement this functionality using print function of window object. The JavaScript print function window.print() will print the current web page when executed. You can call this function directly using onclick event as follows: <head> <script type="text/javascript"> <!-- //--> </script> </head> <body> <form> <input type="button" value="Print" onclick="window.print()" /> </form> </body> This will produce following button which let you print this page. This serves your purpose to get page printed out, but this is not a recommended way of giving printing facility. A printer friendly page is really just a page with text, no images, graphics, or advertising. You can do one of the followings to make a page printer friendly: Mak

Form Validation in JavaScript

Form validation used to occur at the server, after the client had entered all necessary data and then pressed the Submit button. If some of the data that had been entered by the client had been in the wrong form or was simply missing, the server would have to send all the data back to the client and request that the form be resubmitted with correct information. This was really a lengthy process and over burdening server. JavaScript, provides a way to validate form's data on the client's computer before sending it to the web server. Form validation generally performs two functions. Basic Validation - First of all, the form must be checked to make sure data was entered into each form field that required it. This would need just loop through each field in the form and check for data. Data Format Validation - Secondly, the data that is entered must be checked for correct form and value. This would need to put more logic to test correctness of data. We will ta