ng-show ng-if not just in DOM or not

I was thinking I had enough knowledge about the different about ng-if and ng-show which are one adds/removes the containing stuff from the DOM and the latter one just use CSS to hide/show. What’s ironicĀ is I even sometimes use this as an interview question. Today I was bitten by it. According to the Angualrjs Doc:…

execution time of JavaScript code in page load processde

In that short period of time between you wanting to load a page and your page loading, many relevant and interesting stuff happen that you need to know more about. One example of a relevant and interesting stuff that happens is that any code specified on the page will run. When exactly the code runs…

javascript callback with browser dom

prototype is the function template when new is called so that it could be assign to the object’s __proto__. very good video explaining event loop/callback and browswer. Some summary: Typical type of event: User event, XHR event, Timer event. the whole picture is callstack+eventloop+web api. call stack is where the code runs eventloop is where…

add CDATA to xml DOM tree

A CDATA section indicates a block that shouldn’t be parsed. To build a CDATA section just wrap the string with a CDATA object. If append TextNode directly, it will not appear as CDATA but just plain text.