stoimen.com/blog

web developing

Remove DOM Element with JQuery

JQuery and DOM

JQuery is one of the most famous JavaScript library online. There are so much articles in the web about it, that I feel useless to describe it again. The good parts of that library is the amazing way it handles the DOM. It is so good at that that I usually use it with other JavaScript libraries.

Now I’m working on a task and one of the main target of the completed task was the RAM usage of the code. It just has about 100 dynamic DOM elements which on every event should be removed form the tree and the RAM should be freed. Read the rest of this entry »

JavaScript typeof operator

typeof vs ==

It sounds strange but most of the web developers still use == operator to check the ‘undefined’ value of a JavaScript variable. Don’t know why but however there’s typeof operator and I strongly recommend it for that purpose.

It simply should be:

typeof variable == ‘undefined’

Flex 3 DateChooser UTC issue

What I intend to do

The task can be described as it is. There’s a Flex 3 DateChooser component integrated with a custom timeline component. The problem occurs when exporting the data from the flash to the browser. Than I write the unix timestamp to the url of the browser. Of course I’m using date.getTime() in Flex.

getTime()

Applying getTime() to any object of type Date in Flex results in a unix timestamp with included milliseconds. Of course the server side technology which in our case is PHP should devide by 1000 to remove the milliseconds. Read the rest of this entry »

reload the page with javascript

Sometimes there’s a need to reload the page with JavaScript. There’s a built in method for that! Just use:

window.location.reload()

The Problem

Although the SWFObject method – createSWF is working fine under IE sets the wmode not to be transparent but with the strange value of window, i.e. <PARAM name=”WMode” value=”Window” />

The Solution is …

to replace the createSWF method calls with other SWFObject method – embedSWF. There you can simply describe the desired wmode for the flash.