matches the url and does something if it matches a certain string

HTML

<button onclick='get_url_modal();'>Run Function</button>

Javascript

function get_url_modal() {
  var window_location = window.location.href;
  console.log(window.location.href);
  if(window_location.match(/kruxor.com/g)) {
    console.log('page found...');
    // do some stuff if the page matches the window location text
  }
}
$(document).ready(function(){
  get_url_modal();
});

Other Items in javascript
Page Views

This page has been viewed 160 times.

Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.

❤👩‍💻🕹

Random Quote
1. Show your work to the world instead of keeping in your head💆. 2. Do the work consistently👌 3. Respect your work🥰 4. Don't postpone your work 5. Make mistakes 🔥🔥🔥
Unknown