Check out "Do you speak JavaScript?" - my latest video course on advanced JavaScript.
Language APIs, Popular Concepts, Design Patterns, Advanced Techniques In the Browser

Here is how call-to-action widgets probably work

posted in JavaScript on 2021-10-26   widget dom sciprt

Did you ever wondered how the call-to-action widgets work? You know, those little buttons for sharing content in the social networks. Very often they are distributed as iframes but sometimes we have to copy/paste script tags. And the instructions are "Place the following code where you want the button to appear". But if that's a script tag how it knows where to inject the button? The goal of this article is to give you an answer on this question.

read more

Email not working after DNS change

posted in Architecture on 2020-02-07   email dns not working zeit domain working google mx record mail server services thing

I just recently moved my outset.ws domain to Zeit name servers. That's my 13 years old domain which I'm not using it anymore. It makes sense to point to krasimirtsonev.com. The thing is that I have an email which is used all over the net. I of course want to keep that email. And suddenly I wasn't able to receive messages to it. I started missing some very important emails. Like bills that have to be paid and GitHub notifications.

read more

Unit test your client-side JavaScript

posted in JavaScript on 2014-11-20   var register test function message password username js directive jsdom angularjs

I don’t think that we have to discuss the importance of having tests. That’s not something that we add to the project in addition. That’s something that the project is based on. And because testing is so important we have bunch of tools in our disposal. We all know (I hope) how to test our back-end code. However, once we move to the front-end is a bit different. At the moment we are working on a big single page application and testing is one of our main focuses. In this article you will see how to unit test our client-side JavaScript.

read more

Using media queries in JavaScript (AbsurdJS edition)

posted in JavaScript on 2014-03-04   media css function var width window matchmedia dom html mq absurdjs

If you believe in responsive design you probably use a lot of media queries. That's a CSS feature which gives us the power to add something like if statements. We are able to apply rules only if the current page meets certain conditions. In this article I'll show you how I use media queries in JavaScript.

read more

Mastering the DOM access

posted in JavaScript on 2014-02-28   el parent var dom api return selector function val element

If you build web applications you probably communicate with the DOM a lot. Accessing and manipulating DOM elements is the thing which we do almost every day. Very often we collect information from different controls, we need to set values, change the content of div or span tags. Of course there are million libraries which handle these actions. The most popular jQuery, is de factor a standard. However, sometimes you need something smaller. In this article we will build our own class for managing DOM elements.

read more

Convert HTML string to DOM element

posted in JavaScript on 2013-06-11   var markup output el link html frame contentdocument document createelement dom element

Checkout Revealing the magic: How to properly convert HTML string to a DOM element article.

I'm working on a chrome extension which accepts user text, work with it and output the result in a div. I used jQuery in the beginning, for several tasks, but later I decided to remove it and deal with pure javascript/DOM manipulations. The output div was filled by using innerHTML property and everything was ok. But, at some point, I sent few buttons to the user and he has to interact with them. However, once I update the div's content the event listeners are detached and the buttons became non-functional.

read more

checkPolicyFile flag was not set

posted in ActionScript on 2010-10-26   loader var context loadercontext crossdomain xml file checkpolicyfile flag set

Sometimes the uploading of crossdomain.xml file is not enough to get the things working.

read more

Distort MovieClip in Flash with AS3

posted in ActionScript on 2010-09-05   getrandomnum clip setting mtd tweentype out_expo end getrandomnum distort private function number movieclip distortimagewrapper

As you probably know there is no simple way to distort a MovieClip in Flash. The solution that I've found uses AS3. Special thanks to Thomas Pfeiffer and Ruben Swieringa. They share their experience with this problem.

read more