document.addEventListener("DOMContentLoaded", function() { let url = window.location.href; // si está dentro de un iframe if (window.top !== window.self) { url = document.referrer || window.top.location.href; }; const params = new URLSearchParams(window.location.search); const tipo = params.get('typeloan');