Press enter to see results or esc to cancel.

Abraham Garcia Abraham Garcia in Javascript/jQuery   Friday, March 27 2020

Default Ordering Sorting on DataTable.js

How to change the column that DataTable.js Sorts by Default

How to sort by default row on DataTable.js. The number 3 is the column you would like to default the sorting. $(document).ready(function() { $('#example').DataTable( { "order": [[ 3, "desc" ]] } ); } );  

Continue reading
Abraham Garcia Abraham Garcia in Javascript/jQuery   Tuesday, March 24 2020

How to Set Amount of Rows that DataTable Displays

DataTables.js Is a Great JS Table Plugin. Display more than the default rows with this simple plugin option.

This is a snippet that determines the amount of records that will be outputed in the datatable.js plugin. Great plugin to make your html tables nice.  $(document).ready( function () { var table = $('#example').DataTable( { pageLength :

Continue reading
Abraham Garcia Abraham Garcia in Javascript/jQuery   Friday, December 13 2019

Disable Weekday from Datepicker JS

How to disabled Friday, Saturday, or Sunday from Datepicker JS. A Simple Script

This is a snippet to disable Friday, Saturday, and Sunday on the JS Datepicker.  <script> jQuery(document).ready(function($){ jQuery("#datepicker2").datepicker({ minDate: new Date(), dateFormat: 'dd-mm-yy', beforeShowDay:

Continue reading
Abraham Garcia Abraham Garcia in Javascript/jQuery   Monday, November 25 2019

Remove All Matching Classes From Page jQuery

How to Remove All Classes from HTML DOM. This matches for similar classes and removes them.

This is a small snippet on how to remove all classes from matched class on jQuery.  $('#builder [class*="ui-id-"]').removeClass(function(i, j) { return j.match(/ui-id-/g).join(" "); }); Full

Continue reading
Abraham Garcia Abraham Garcia in Javascript/jQuery   Saturday, November 16 2019

Stripe New JS Button Example

This is the New Stripe JS Integration with PHP. I had not done this in a while so it was a little hard getting integrated, but it was fun.

These are the code snippets to get started with the New Stripe JS Button. HTML <div id="card-element"> <!-- A Stripe Element will be inserted here. --> </div> <!-- Used to display form errors. --> <div

Continue reading
Abraham Garcia Abraham Garcia in Javascript/jQuery   Friday, November 8 2019

How to Select all Text in a Input Box with One Click

Use OnClick to Select all text in a textbox to copy and paste fast. Useful for developers that need sharable links.

This is a code snippet to select all text in a textbox with javascript.  <input onClick="this.select();" value="Sample Text" /> or <input onClick="this.setSelectionRange(0, this.value.length)" value="Sample Text" />  

Continue reading
Abraham Garcia Abraham Garcia in Javascript/jQuery   Friday, October 11 2019

How to Autoplay a Video Via jQuery Video HTML MP4

Learn How to AutoPlay a HTML5 Video Through jQuery. Simple One Line Code.

Learn How to AutoPlay your HTML5 Video via jQuery Snippet.  $("#video_player")[0].play(); or $("#video_player")[0].autoplay = true;

Continue reading
Abraham Garcia Abraham Garcia in Javascript/jQuery   Thursday, September 26 2019

How to Get Product Summary ClickFunnels for Tracking on Facebook Pixel or Google

A Snippet to pass order value to facebook from clickfunnels confirmation screen.

How to get order total of clickfunnel summary at the end of the funnel. This script loops all the elements with the amount class and adds them. It then creates a variable to pass on to the facebook event. We named the variable myOrderTotal

Continue reading
Best JS Notifications Plugin Library - NOTY
Abraham Garcia Abraham Garcia in Javascript/jQuery   Thursday, August 22 2019

Best JS Notifications Plugin Library - NOTY

A Depedency-Free Notifications Library.

This is a library for JS Notificications on the Fly. It is super simple to install and use.  For Installation <link href="lib/noty.css" rel="stylesheet"> <script src="lib/noty.js" type="text/javascript"></script> Create a

Continue reading
Abraham Garcia Abraham Garcia in Javascript/jQuery   Tuesday, January 1 2019

My Favorite jQuery Lightbox for Youtube and Vimeo Videos

Best jQuery Lightbox for Youtube and Vimeo Video Pop Ups.

This is my favorite jQuery Plugin for Youtube or Vimeo Lightbox. It is sosimple to use and has great documentation.  Installation <link href="dist/lity.css" rel="stylesheet"> <script src="vendor/jquery.js"></script>

Continue reading