banner

React.js | Advanced Todo App from scratch for beginner | Bootstrap | In a nut shell

Introduction

It is a good practice to follow community standards while developing softwares. It has some major pros like

  • Its easier to understand and debug/maintain software
  • quicker to get help when needed from community
  • It will lower development cost [Money and Time]

We will be taking the convention used by this project into consideration. react-slingshot

Initialize

Make a dir called ‘todo‘ and initialize a node.js app. Continue reading

Browser support for HTTP request methods like PUT/DELETE/PATCH

HTML forms (up to HTML version 4 and XHTML 1) only support GET and POST as HTTP request methods. A workaround for this is to tunnel other methods through POST by using a hidden form field which is read by the server and the request dispatched accordingly.

However, GET, POST, PUT and DELETE are supported by the implementations of XMLHttpRequest (i.e. AJAX calls) in all the major web browsers (IE, Firefox, Safari, Chrome, Opera).

Sources:

http://stackoverflow.com/questions/165779/are-the-put-delete-head-etc-methods-available-in-most-web-browsers

Javascript : Deleting cookies from the current page

function deleteCookie(name) {
        document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
    }

    document.cookie = 'man=my_value';

    deleteCookie('man');

To delete all the cookies from a page

function deleteAllCookies() {
    var cookies = document.cookie.split(";");

    for (var i = 0; i < cookies.length; i++) {
    	var cookie = cookies[i];
    	var eqPos = cookie.indexOf("=");
    	var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
    	document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
    }
}