Skip to main content

Posts

Search Table Row by jquery

Search Table Row by jquery Search content from table using jQuery. Live searching method via jquery Create function to remove highlight content. If content not matched. function removeHighLighting (elm){         elm.each(function(){             var element = $(this);             element.replaceWith(element.html());         })     } Create function to highlight matched content. function addHighLighting (elm, data){         var text = elm.text();         var highlightedText = '<em>' + data+ '</em>';         var newText = text.replace(data, highlightedText);         elm.html(newText);     } Search text on keyup $("#search").on("keyup", function() {     ...

Server Side Datatable handling using PHP and MySql

Server Side Datatable handling using PHP and MySql jQuery datatable server side processing. Using jQuery Ajax and MySql. Step 1: View Layout for display Student Record index.html  <!DOCTYPE html> <html>     <head>         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />         <title>Server Side Datatable handling</title>         <link rel="stylesheet" id="font-awesome-style-css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" media="all">         <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.9/css/jquery.dataTables.min.css"/>                 <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jQue...

PHP Save Image in Base64 Encode Format

Save image in database in base64_encode format. 1. Create HTML Form <!DOCTYPE html> <html> <body> <form action="upload.php" method="post" enctype="multipart/form-data">     Select image to upload:     <input type="file" name="to_upload" id="fileToUpload">     <input type="submit" value="Upload Image" name="submit"> </form> </body> </html> 2. Now in upload.php if(!empty($_FILES)){     $extension = pathinfo($_FILES["to_upload"]["tmp_name"], PATHINFO_EXTENSION);     $image_content = file_get_contents($_FILES["to_upload"]["tmp_name"]);     $image_content = base64_encode($image_content);     $binaryData = 'data:image/' . $extension . ';base64,' . $image_content; } Store $binaryData value in database. 3. Html form your you need to display. <img src="<?php...

Refresh a particular div jQuery

Refresh a particular div jQuery Method 1: How to refresh a particular div content when page is loading through ajax load() function <ul id="nav" class="nav" style="font-size:12px;"> <li><a href="#" data-url="location.html">Location</a></li> <li><a href="#" data-url="multi.html">Multi-Location</a></li> </ul> <div id="home"></div> $('#nav a').on('click', function(e){      e.preventDefault();      $('.active').removeClass('active'); // removes the active class from other link      $(this).addClass('active'); // adds the active class to current cliked link      setInterval(function(){        $("#home").load($('.active').data('url'),{},function(){}); // populates the div with data-url of active class.      }, 5000); }); $('#nav li:eq(0) a').trigge...

FusionCharts in jQuery

Visualizing Data Makes It Easier To Read When dealing with data analysis, most companies rely on MS Excel or Google Sheets. While those are powerful tools, it’s difficult to notice trends, much less make any sense out of large rows of spreadsheet data. Dealing with data presented this way isn’t very interesting, but once you add visualization to that data, things become easier to manage, and that’s the topic of today’s tutorial - making interactive charts using jQuery. It’s difficult to notice trends from rows of spread sheet data, but once you add visualization... I will use  FusionCharts’ JavaScript chart library  for this project as it offers a large library of 90+ charts, is compatible with every browser, and is pretty easy to work with. It also offers a dedicated plugin for jQuery that will make our job easier. I will start by making a basic chart using FusionCharts’ core JavaScript library and its  jQuery charts plugin , then I will add the drill-down ...