hello.js

var please = require('share');
console.log('thank you');

NEW !!!

Saturday, 20 February, 2016 UTC

Are Javascript functions objects?

A Javascript function is also an object of type function. So it can be used as an object and can have member variables. Also note read more The post Are Javascript functions objects? appeared first on InfoHeap. ... more


Thursday, 18 February, 2016 UTC

Javascript onscroll event handler with throttling

Javascript onscroll event handler is called on every onscroll event. At times we want to ensure that it is not called again before a certain read more The post Javascript onscroll event handler with throttling appeared first on InfoHeap. ... more


Thursday, 18 February, 2016 UTC

Javascript onscroll event handler

Javascript onscroll event handler can be attach to any DOM element. Attaching it to document is a typical use case. But it can be attached read more The post Javascript onscroll event handler appeared first on InfoHeap. ... more


Wednesday, 17 February, 2016 UTC

Javascript – run a function at regular intervals

Javascript setInterval can be used to make repeated calls to a function or code with fixed interval. If there is a possibility that function logic read more The post Javascript – run a function at regular intervals appeared first on InfoHeap. ... more


Wednesday, 17 February, 2016 UTC

Javascript sleep implementation

Javascript does not have any sleep function. At times (e.g. to simulate a specific situation) we may need to sleep or delay the code for read more The post Javascript sleep implementation appeared first on InfoHeap. ... more


Wednesday, 17 February, 2016 UTC

Javascript settimeout example

Javascript setTimeout can be used to scheduled a function or code to run at a specified delay. This is pretty powerful API and can be read more The post Javascript settimeout example appeared first on InfoHeap. ... more


Tuesday, 16 February, 2016 UTC

Javascript event bubble vs capture

Javascript/HTML events can propagate in two ways in DOM API. This is relevant when more than one element are listening on same event. Event propagation read more The post Javascript event bubble vs capture appeared first on InfoHeap. ... more


Tuesday, 16 February, 2016 UTC

Javascript how to stop evet propagation

Javascript/HTML event can be handled by more than one dom elements and after one handler, it propagate to next element. API Event.stopPropagation() can be used read more The post Javascript how to stop evet propagation appeared first on InfoHeap. ... more


Monday, 15 February, 2016 UTC

jQuery how to load a url into an element

jQuery .load() can be used to make an Ajax call (GET or POST) and load the results into an element by settings result into its read more The post jQuery how to load a url into an element appeared first on InfoHeap. ... more


Sunday, 14 February, 2016 UTC

How to trigger click using jQuery or Javascript

Sometime we need to manually trigger a click event on an element (e.g. button). Here are Javascript and jQuery code snippets for this. This is read more The post How to trigger click using jQuery or Javascript appeared first on InfoHeap. ... more


Sunday, 14 February, 2016 UTC

jQuery post example

Javascript code snippet to submit a form using POST to server and process returned data. Here when submit button is clicked we serialize whole form read more The post jQuery post example appeared first on InfoHeap. ... more


Friday, 12 February, 2016 UTC

React – list of all factory methods of React.DOM

React has many factory methods for inbuilt components like div, span, etc. Here is javascript code snippet which can be used to dump all methods read more The post React – list of all factory methods of React.DOM appeared first on InfoHeap. ... more


Friday, 12 February, 2016 UTC

React component tutorial with click handler – javascript version

This tutorial is javascript version is React component tuorial with click handler – jsx version. It is recommended that you visit that tutorial before reading read more The post React component tutorial with click handler – javascript version appeared ... more


Friday, 12 February, 2016 UTC

Javascript – print all methods of an object

To print all methods of an object, we can use Object.getOwnPropertyNames and check if the corresponding value is a function. The Object.getOwnPropertyNames() method returns an read more The post Javascript – print all methods of an object appeared first ... more


Thursday, 11 February, 2016 UTC

React javascript render hello world (without jsx)

React render can be written purely in Javascript without jsx. For JSX version of this tutorial you can visit React jsx hello world. Here is read more The post React javascript render hello world (without jsx) appeared first on InfoHeap. ... more


Thursday, 11 February, 2016 UTC

React component tutorial with click handler – jsx version

A basic React components implement a render method that takes input data and returns what to display. For the purpose of this tutorial, it will read more The post React component tutorial with click handler – jsx version appeared first on InfoHeap. ... more


Thursday, 11 February, 2016 UTC

React – JSXTransformer vs babel – which one should be used?

Question: I see tutorials using JSXTransformer and babel in various articles. Which one should be used? React was using JSXTransformer to compile and transform jsx read more The post React – JSXTransformer vs babel – which one should be used? appeared ... more


Thursday, 11 February, 2016 UTC

Javascript arrow function examples

Arrow (=>) function expressions are shorter syntax compared to function expressions. Arrow functions are always anonymous. Here are some commonly used usage syntax patterns. singleParam read more The post Javascript arrow function examples appeared ... more


Wednesday, 10 February, 2016 UTC

React jsx hello world with offline transformation

React JSX code can be compiled offline to transform into javascript code. This eliminates need to include babel code in browser. To see how it read more The post React jsx hello world with offline transformation appeared first on InfoHeap. ... more


Tuesday, 9 February, 2016 UTC

React jsx hello world

JSX is a JavaScript syntax extension that looks similar to XML. It is used by React code and it is optional to use JSX. Everything read more The post React jsx hello world appeared first on InfoHeap. ... more


Tuesday, 9 February, 2016 UTC

ReactJS – convert jsx to javascript using babel cli

React JSX code can be offline transformed into javascript code using babel compiler command line tool. You may also want to visit React JSX quick read more The post ReactJS – convert jsx to javascript using babel cli appeared first on InfoHeap. ... more


Sunday, 7 February, 2016 UTC

Javascript/jQuery – disable right click

Right click can be disable by attaching a even listener to contextmenu event. It can be done using jQuery or vanilla Javascript. disable right click read more The post Javascript/jQuery – disable right click appeared first on InfoHeap. ... more


Monday, 1 February, 2016 UTC

AngularJS controller basic clock example

Angularjs basic controller clock example to display date and update it every second. We’ll use controller, template and $timeout. We used AngularJS $timeout here. If read more The post AngularJS controller basic clock example appeared first on InfoHeap. ... more


Monday, 1 February, 2016 UTC

AngularJS simple controller tutorial to increment a number

Angularjs basic controller example to initialize a number in view, and then increment it on button click. We’ll use controller, template and ng-click directive. The read more The post AngularJS simple controller tutorial to increment a number appeared ... more


Monday, 1 February, 2016 UTC

HTML5 shadow dom example

HTML5 shadow dom is part of Web components. It is currently in draft stage and supported by Chrome. It can also be compared with react read more The post HTML5 shadow dom example appeared first on InfoHeap. ... more


Sunday, 31 January, 2016 UTC

HTML5 canvas draw image examples

HTML5 canvas draw image examples using drawImage(). Using image from html Using javascript Img object The post HTML5 canvas draw image examples appeared first on InfoHeap. ... more


Sunday, 31 January, 2016 UTC

Javascript – DOM appendChild example

Javascript DOM method appendChild can be used to append a child to existing DOM element. For example it can be used to append an Image, read more The post Javascript – DOM appendChild example appeared first on InfoHeap. ... more


Friday, 29 January, 2016 UTC

HTML5 canvas basic example

HTML5 canvas can be used to draw graphic in web page HTML using Javascript. Here is a basic example of HTML canvas for beginners. HTML5 read more The post HTML5 canvas basic example appeared first on InfoHeap. ... more


Friday, 29 January, 2016 UTC

Javascript DOMContentLoaded listener example

DOMContentLoaded event is fired when document DOM is ready and before images, etc. are loaded. It is similar to jQuery $(document).ready(). Here is code snippet read more The post Javascript DOMContentLoaded listener example appeared first on InfoHeap. ... more


Friday, 29 January, 2016 UTC

Javascript – ready vs on load event handler example

HTML document ready event is called before image assets, etc. are loaded on the page. window onload handler is called once all assets have been read more The post Javascript – ready vs on load event handler example appeared first on InfoHeap. ... more