Skip to main content

Posts

Printing DIV contents with CSS using JavaScript and jQuery

  < script type ="text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></ script > < script type ="text/javascript"> $( function () {     $( "#btnPrint" ).click( function () {         var contents = $( "#dvContents" ).html();         var frame1 = $( '<iframe />' );         frame1[0].name = "frame1" ;         frame1.css({ "position" : "absolute" , "top" : "-1000000px" });         $( "body" ).append(frame1);         var frameDoc = frame1[0].contentWindow ? frame1[0].contentWindow : frame1[0].contentDocument.document ? frame1[0].contentDocument.document : frame1[0].contentDocument;         frameDoc.document.open();    ...
Recent posts

How to search by multiple key => value in PHP array

<?php // PHP program to search for multiple // key=>value pairs in array function search($array, $search_list) {     // Create the result array     $result = array();     // Iterate over each array element     foreach ($array as $key => $value) {         // Iterate over each search condition         foreach ($search_list as $k => $v) {                 // If the array element does not meet             // the search condition then continue             // to the next element             if (!isset($value[$k]) || $value[$k] != $v)             {                 ...

multiple google map place fields

<body onload="initialize()"> <script>     function initialize() {         var acInputs = document.getElementsByClassName("autocomplete");         for (var i = 0; i < acInputs.length; i++) {             var autocomplete = new google.maps.places.Autocomplete(acInputs[i]);         }     }     initialize(); </script> <input class="autocomplete" placeholder="Enter your address" type="text"></input> <br /> <br /> <input class="autocomplete" placeholder="Enter your address" type="text"></input> <br /> <br /> <input class="autocomplete" placeholder="Enter your address" type="text"></input> <script src="https://maps.googleapis.com/maps/api/js?key=[]&libraries=places&callback=initAutocomplete"      ...

HTML5 video code with scripts and css custom made

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="servicedetail"> <div class="servicedetailimg youtubelink"> <div id="player"> <div id="serunmutebtntext">Click to unmute</div> <video id="video-element" autoplay="autoplay" style="width:100%;">             <source src="anyvideo.mp4" type="video/mp4" />         </video> <div id="controls"> </div> </div> </div> </div> <script type="text/javascript">   /** custome controller **/ document.getElementById('controls').innerHTML='<button id="btnPlayPause" class="play" title="play" accesskey="P" onclick="playPauseVideo();">Play</button><progress id="progress-bar" min="0" max="100...

get live location from ip and zip codes

<html xmlns="http://www.w3.org/1999/xhtml"> <head>     <title></title>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body>     <script type="text/javascript">         jQuery(document).ready(function($){                $.getJSON( "http://ip-api.com/json", function( data ) {               var items = [];               $.each( data, function( key, val ) {                 if ( key == 'zip' ){                 alert( key + ": " + val );                 }  ...