Hi everyone please I need you're help !!
How could I do something like this:
<script type="text/javascript">
$(document).ready(function() {
if (window.location.href.indexOf(" ") > -1) {
alert("your url index is empty");
}
});
</script>
I need to know whene my Url index contain something (ID number) or empty.
CodePudding user response:
This should get the job done:
if (window.location.href.match(/\d /g)) {
alert("your url index is empty");
}