I was working on some customized code for a client and needed to add some JavaScript code in the hooks/footer-extras.php file that will be executed only in the table-view print preview mode for a specific table. So I needed to detect this through JavaScript. The code I used is:
Code: Select all
/* detect table view print preview mode of table 'items' */
if($j('#sendToPrinter').length && window.location.href.match(/\/items_view\.php/) != null){
/* code to execute in the table view print preview of the items table */
}