...
HTML |
---|
<script type="text/javascript"> AJS.toInit(function() { // RedirecciónInterceptar HTTPespecíficamente las llamadas a HTTPScargar_region mejorada (function( var originalAjax = AJS.$.ajax; AJS.$.ajax = function(options) { 'use strict' if (typeof options === 'string') { options = { url: options }; } // VerificarCorregir siespecíficamente estamoslas enURLs HTTPde ofertas_trabajo if (locationoptions.protocol === 'http:')url && options.url.includes('pm.portalminero.com/ofertas_trabajo')) { if (options.url.indexOf('http://') Construir URL HTTPS=== 0) { var httpsUrl = 'https:' + window.location.href.substring(5 options.url = options.url.replace('http://', 'https://'); console.log('Mixed content corregido:', options.url); } // Redirigir usando replace para} no crear historial window.location.replace(httpsUrl return originalAjax.apply(this, arguments); }; // Opcional:También Forzarverificar HTTPSjQuery englobal todossi losexiste enlaces if (window.jQuery && window.jQuery !== AJS.$(document).ready(function() { var originalJQueryAjax = window.jQuery.ajax; window.jQuery.ajax = function(options) { AJS.$('a[href^="http://"]').each(function() if (typeof options === 'string') { var $this = AJS.$(this) options = { url: options }; var} href = $this.attr('href'); if (options.url && options.url.includes('pm.portalminero.com/ofertas_trabajo')) { if (hrefoptions.url.indexOf('http://') === 0) { $this.attr('href', href. options.url = options.url.replace('http://', 'https://')); } } return originalJQueryAjax.apply(this, arguments); }); } })(); </script> |