Code Is Poetry

Life is Binary


Javascript: url extraction from string

                    var string = " - the site of a full stack web developer";                     if(new RegExp("([a-zA-Z0-9]+://)?([a-zA-Z0-9_]+:[a-zA-Z0-9_]+@)?([a-zA-Z0-9.-]+\\.[A-Za-z]{2,4})(:[0-9]+)?(/.*)?").test(string))...

Read more

javascript Multiple defer elemetns example

javascript Multiple defer elemetns example (function(){function getScript(url,success){var script=document.createElement('script'); script.src=url;var head=document.getElementsByTagName('head')[0],done=false; script.onload=script.onreadystatechange =function(){if(!done&&(!this.readyState ||this.readyState =='loaded'||this.readyState =='complete')){done=true; success(); script.onload = script.onreadystatechange =null; ...

Read more

jQuery animated swap div content on hover effect

jQuery animated swap div content on hover effect jQuery ContentHover Plugin jQuery:$(function(){    $("#vertical div.wrap").hover(function(){        $(this).stop().animate({top:"-130px"},{queue:false,duration:200}); ...

Read more

jquery ui datepicker - only select specific days

For example you need to make visible only Tuesday(2) and Wednesday(3), then it can be done by putting following code as datepicker options. It is to be noted that, datepicker's dateoffset starts with 0 and ends with 6 mapping Sunday to Friday respectively. beforeShowDay: function(date){   var day = date.getDay();   return [day == 2 || day == 3,""];}

Read more

Enabling Jsview addon although it is discontined from firefox addon repo

Yes it is disabled and you cannot find it in firefox addon repo. It was very useful tool for web developer like me and  still it is very favorite addon amongst firefox addon. So, prune your sad feelings.  Simply copy and paste following link and follow the browser instruction and you will be happy to see this jsview addon to life again.

Read more

Identify browser

Detecting Firefox x.x <script type=”text/javascript”> if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits); var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number if (ffversion>=3) document.write(“You’re using FF 3.x or above”) else if (ffversion>=2) document.write(“You’re using FF 2.x”) else if...

Read more