2016 m. sausio 9 d., šeštadienis

Javacript document.write catch


If you're dealing with 3rd party scripts, simply replacing document.write to capture the output and stick it in the right place isn't good enough, since they could change the script and then your site would break.
writeCapture.js does what you need (full disclosure: I'm the author). It basically rewrites the script tags so that each one captures it's own document.write output and puts it in the correct place. The usage (using jQuery) would be something like:
$(document.body).writeCapture().append('<script type="text/javascript" src="http://3rdparty.com/foo.js"></script>');
Here I'm assuming that you want to append to the end of the body. All jQuery selectors and manipulation methods will work with the plugin, so you can inject it anywhere and however you want. It can also be used without jQuery, if that is a problem.

2016 m. sausio 8 d., penktadienis

2016 m. sausio 7 d., ketvirtadienis

Neapkraunantis youtube užkrovimas

Jei viename tinklalapio lange norite ikelti daug youtube video, tai labai akraus puslapi, jei desite embeded visus youtube video. Todel geriau deti tik youtube cover paveiksleli su ant virsaus nupiestu play mygtuku. Istraukti coveri ir ji suaktyvinti, kad paspaudus coveri isikeltu grotuvas, nesunkiai galima padaryti su JS funkcija: http://www.sitepoint.com/faster-youtube-embeds-javascript/

Lightweight social share buttons

be addthis.com dar yra paprastas lengvas skriptukas http://sapegin.github.io/social-likes/  ( https://github.com/sapegin/social-likes )

papsrastas budas pasidaryti mytukus su fontawesome: http://webdesignerhut.com/css-social-sharing-buttons/

Geras budas pasidaryti mygtukus su counteriais, ne atskiro srifto failo (sriftas itrauktas i js): http://sapegin.github.io/social-likes/