Tuesday, May 28, 2013

Dynamic change facebook like button href


12down voteaccepted
It works for me for XFBML tag as well without using FB iframe and even works with multiple FB like calls for AJAX
You just need to wrap the entire XFBML code in JS/jQuery and parse it as shown below:
$('#like').html('<fb:like href="' + url + '" layout="button_count" show_faces="false" width="65" action="like" font="segoe ui" colorscheme="light" />');
if (typeof FB !== 'undefined') {
    FB.XFBML.parse(document.getElementById('like'));
}
HTML code:
<span id="like"></span>
Surly this is going to be helpful for more guys :)

Thursday, May 16, 2013

Clear an IMG with jQuery

Alternately you could change the src to a 1x1 pixel: $('img').attr('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==');

Friday, May 3, 2013

Jquery show preview image for file upload control


<script type="text/javascript">     

function uploadFile(input) {         

if (input.files && input.files[0]) {            

 var reader = new FileReader();              
 reader.onload = function (e) {                 
 $('#test').attr('src', e.target.result).width(100).height(100);             
 };               
 reader.readAsDataURL(input.files[0]);        
 }     
} 

</script> 

<input type='file' onchange="uploadFile(this);" />     <img id="test" src="#" alt="my image" /> 

Thursday, May 2, 2013

File Upload plugin

http://blueimp.github.io/jQuery-File-Upload/index.html

http://www.webtrendset.com/2011/06/22/complete-code-example-for-using-blueimp-jquery-file-upload-control-in-asp-net/

Wednesday, May 1, 2013

Good movies

k-pax, fear and loathing in las vegas, ed wood, the ninth gate, lord of kings, hobbit.