Hola a todos por favor necesito su ayuda !!
¿Cómo podría hacer algo como esto:
<script type="text/javascript"> $(document).ready(function() { if (window.location.href.indexOf(" ") > -1) { alert("your url index is empty"); } }); </script>Necesito saber cuándo mi índice de Url contiene algo (número de ID) o está vacío.
Esto debería hacer el trabajo:
if (window.location.href.match(/\d+/g)) { alert("your url index is empty"); }