dimanche 30 août 2015

Using JavaScript & Regex how to check if my current url matches a certain pattern?

The pattern of the url would have to match this: http://ift.tt/1ErBgYW

if(current url matches the pattern) then execute code end if

<script type="text/javascript">

    var currentURL = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname;

</script>

Aucun commentaire:

Enregistrer un commentaire