Yuri Perevoznikov's blog

Posts about programming by web developer

Hey! How are you guys (girls?)?

I want to tell you a bit about ways to make container that can wrap included elements. Huh, you’ve already read about it in title? (:

I’m talking about next simple example:

<div style="background: red; padding: 5px;">
	<div style="background: green; float: left; padding: 5px;">First</div>
	<div style="background: yellow; float: left; padding: 5px;">Second</div>
</div>

continue reading…

Hi to all,

you can find my new script for deleting redirects in google search pages here – http://userscripts.org/scripts/show/90395

Hello,

I’ve added the simplest script to userscripts.org that can change all styles of links on pages. Take a look – maybe you’ll like it.

Hi,

I added new script to my userscripts.org directory.

Enjoy.

Hi guys, and girls for sure;)

I tried to parse huge csv file a little before and found interesting thing: continue reading…

Sometimes you need operate timestamp, so there is how you can get it:

Date.prototype.getTimestamp = function() {
    return parseInt((this.getTime()-Date.UTC(1970,0,1))/1000);
}

after this you are able to use this method:

var d = new Date();
alert(d.getTimestamp());

and that’s it, cheers.

Update:
There is another way to get timestamp if you use jQuery:

alert($.now());

You can find detailed info about this method here.

These functions show messages passed as param, but(!) if this param is number then php interpreter thinks that param is error code and doesn’t show it. So be careful again – convert param to string before you pass something to these functions.

It seems that these functions for escaping url in js are already deprecated! You should use functions with more longer names – encodeURIConmpnent(), decodeURIComponent(). Use them to encode/decode params for url.

http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp

http://www.w3schools.com/jsref/jsref_decodeuricomponent.asp

The problem appears when you try to get items from block with style `overflow: hidden` because you cannot drag elements further than border of parent element. JQuery can almost everything and this task is accessible for its too probably it’s not so obvious – just look at fix in file:

draggable_fix.htm
continue reading…

Did you try to bind method of javascript class to event of html object?
That’s not so simple as it may imagine at first sign.

I almost ensure that you’ll try to write something like this first continue reading…