To Print Div

<script type=”text/javascript”> function PrintElem(elem) { Popup($(elem).html()); } function Popup(data) { var mywindow = window.open(”, ‘mydiv’, ‘height=400,width=600’); mywindow.document.write(‘<html><head><title>my div</title>’); /*optional stylesheet*/ //mywindow.document.write(‘<link rel=”stylesheet” href=”main.css” type=”text/css” />’); mywindow.document.write(‘</head><body >’); mywindow.document.write(data); mywindow.document.write(‘</body></html>’); mywindow.document.close(); // necessary for IE >= 10 mywindow.focus(); // necessary for IE >= 10 mywindow.print(); mywindow.close(); return true; } </script>Read more …
cavinz

How To Remove Comma Separated Value From INPUT OR STRING using Jquery Or Javascript ?

Here is the function for remove comma separated value from input or string , function removeValue(list, value) { if( list.indexOf(‘,’+value+’,’) != -1 ){ return list.replace(new RegExp(‘,?’+ value + ‘,?’), ‘,’); } else{ return list.replace(new RegExp(‘,?’+ value + ‘,?’), ”) } } where list = VALUE OF STRING; value= SEARCH VALUE;...Read more …
cavinz

How to change URL Without Refreshing Page Using Javascript?

Here is the function to change URL without refreshing page. function ChangeUrl(page, url) { if (typeof (history.pushState) != “undefined”) { var obj = { Page: page, Url: url }; history.pushState(obj, obj.Page, obj.Url); } else { alert(“Browser does not support HTML5.”); } } Call this function like this , ChangeUrl(YOUR TITTLE,YOUR...Read more …
Harrisonm

Preview an image before it is uploaded

I want to be able to preview a file (image) before it is uploaded. The preview action should be executed all in the browser without using Ajax to upload the image. [crayon-62f8f003bb513208780901/] and the associated HTML: [crayon-62f8f003bb517351022704/] The FileReader object lets web applications asynchronously read the contents of files (or...Read more …