Skip to main content

Posts

Showing posts from March, 2013

How to delete first preceding element

Here is the html from which I want to remove the div element 'div' by clicking the link. <div> <a href="javascript:void(0)" class="link">My link</a> </div> To access   the preceding element I will use the .parents() method of jQuery and then call  the method .remove() to remove the 'div' element. Here is the code... $('a.link').click(function() { $(this).parents('div:first').remove(); });

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.