How to join two javascripts in the correct way?
How to join two javascripts in the correct way?

1. How to join two javascripts in the correct way?
2. How to change $ into jQuery setting?
$(document).ready(function() {
var oTable = $('#example').dataTable( {
"bSortClasses": false
} );
oTable.$('td').hover( function() {
var iCol = $('td', this.parentNode).index(this) % 5;
$('td:nth-child('+(iCol+1)+')', oTable.$('tr')).addClass( 'highlighted' );
}, function() {
oTable.$('td.highlighted').removeClass('highlighted');
} );
} );
$(document).ready(function() {
$('#example').dataTable( {
"fnDrawCallback": function ( oSettings ) {
var that = this;
/* Need to redo the counters if filtered or sorted */
if ( oSettings.bSorted || oSettings.bFiltered )
{
this.$('td:first-child', {"filter":"applied"}).each( function (i) {
that.fnUpdate( i+1, this.parentNode, 0, false, false );
} );
}
},
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
],
"aaSorting": [[ 1, 'asc' ]]
} );
} );
2. How to change $ into jQuery setting?
$(document).ready(function() {
var oTable = $('#example').dataTable( {
"bSortClasses": false
} );
oTable.$('td').hover( function() {
var iCol = $('td', this.parentNode).index(this) % 5;
$('td:nth-child('+(iCol+1)+')', oTable.$('tr')).addClass( 'highlighted' );
}, function() {
oTable.$('td.highlighted').removeClass('highlighted');
} );
} );
$(document).ready(function() {
$('#example').dataTable( {
"fnDrawCallback": function ( oSettings ) {
var that = this;
/* Need to redo the counters if filtered or sorted */
if ( oSettings.bSorted || oSettings.bFiltered )
{
this.$('td:first-child', {"filter":"applied"}).each( function (i) {
that.fnUpdate( i+1, this.parentNode, 0, false, false );
} );
}
},
"aoColumnDefs": [
{ "bSortable": false, "aTargets": [ 0 ] }
],
"aaSorting": [[ 1, 'asc' ]]
} );
} );
This discussion has been closed.