Blog Spot!


Make an AJAX call with Vanilla Java Script

var r = new XMLHttpRequest();

r.open("POST", "http://httpbin.org/post", true);
r.setRequestHeader('Content-Type', 'application/json');

r.onreadystatechange = function () {
  if (r.readyState !== 4 || r.status !== 200) {
      return;
  }
  console.log(r.responseText);
};

r.send("password=qwerty");

vanilla.js

Added on 20.Feb.2015
Tags: js ajax vanilla

How To Setup MongoDB, PHP5 & Apache2 on Ubuntu

MongoDB is an open source NoSQL database. These days mongodb is getting more popularity between web developers for their processing speed. And for PHP5 we all are aware that it is use widely use for faster development.

Full Article

Added on 13.Feb.2015
Tags: php ubuntu mongodb apache2

phpMyAdmin - mcrypt extension is missing

sudo apt-get install php5-mcrypt
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt 
sudo service apache2 restart

Added on 11.Feb.2015
Tags: phpmyadmin php mcrypt

What is Knockout.js and how is it different from jQuery?

What is..

Knockout.js is a javascript library that allows us to bind html elements against any data model. It provides a simple two-way data binding mechanism between your data model and UI means any changes to data model are automatically reflected in the DOM(UI) and any changes to the DOM are automatically reflected to the data model.

What is not..

Knockout.js is not a replacement of jQuery, Prototype, or MooTools. It doesn’t attempt to provide animation, generic event handling, or AJAX functionality (however, Knockout.js can parse the data received from an AJAX call). Knockout.js is focused only on designing scalable and data-driven UI.

Knockout.js uses a Model-View-ViewModel (MVVM) design pattern in which the model is your stored data, and the view is the visual representation of that data (UI) and ViewModel acts as the intermediary between the model and the view

Article
Knockout.JS

Added on 04.Feb.2015
Tags: knockout jquery js mvvm

3 Ways to Define a JavaScript Class

JavaScript is a very flexible object-oriented language when it comes to syntax. In this article you can find three ways of defining and instantiating an object. Even if you have already picked your favorite way of doing it, it helps to know some alternatives in order to read other people's code.

It's important to note that there are no classes in JavaScript. Functions can be used to somewhat simulate classes, but in general JavaScript is a class-less language. Everything is an object. And when it comes to inheritance, objects inherit from objects, not classes from classes as in the "class"-ical languages.

  • Using a function
    • Methods defined internally
    • Methods added to the prototype
  • Using object literals
  • Singleton using a function

Read the article here.

Added on 29.Jan.2015
Tags: js class

Search


PHP Libraries


Carbon lib / docs
Idiorm lib / docs
Image Workshop lib / docs
lorenzos/Minixed lib / docs
Parsedown lib / docs
PHP Paginator lib / docs
PHP Redis lib / docs
QrCode lib / docs
Requests lib / docs
Slim lib / docs
Spyc lib / docs
TWIG lib / docs
Upload lib / docs
Validation lib / docs
Zebra Image lib / docs

JS Libraries


AJV lib / docs
BackboneJS lib / docs
Bootstrap Notify lib / docs
C3.js lib / docs
ChartJS lib / docs
FastMD5 lib / docs
HighlightJS lib / docs
jQuery-Storage lib / docs
JS-Cookie lib / docs
Leaflet JS lib / docs
LowDB lib / docs
Marked lib / docs
NeedlyJS lib / docs
ParcelJS lib / docs
RequireJS lib / docs
Swig lib / docs
Toastr lib / docs
Underscore lib / docs
ValidateJS lib / docs
top