$(document).ready(function() { $('a[href*="/projet/element.php"]').each(function() { $(this).attr('href', function(index, oldHref) { if (oldHref.includes('/custom/')) { return oldHref; } return oldHref.replace( "/projet/element.php", "/custom/technistyle/projet/element.php" ); }); }); $('a[href*="/supplier_proposal/card.php"]').each(function() { $(this).attr('href', function(index, oldHref) { if (oldHref.includes('/custom/')) { return oldHref; } return oldHref.replace( "/supplier_proposal/card.php", "/custom/technistyle/supplier_proposal/card.php" ); }); }); $('form[action*="/supplier_proposal/card.php"]').each(function() { $(this).attr('action', function(index, oldHref) { if (oldHref.includes('/custom/')) { return oldHref; } return oldHref.replace( "/supplier_proposal/card.php", "/custom/technistyle/supplier_proposal/card.php" ); }); }); $('a[href*="/fourn/commande/card.php"]').each(function() { $(this).attr('href', function(index, oldHref) { if (oldHref.includes('/custom/')) { return oldHref; } return oldHref.replace( "/fourn/commande/card.php", "/custom/technistyle/fourn/commande/card.php" ); }); }); $('form[action*="/fourn/commande/card.php"]').each(function() { $(this).attr('action', function(index, oldHref) { if (oldHref.includes('/custom/')) { return oldHref; } return oldHref.replace( "/fourn/commande/card.php", "/custom/technistyle/fourn/commande/card.php" ); }); }); });