Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check if url contains string

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
    if (window.location.href.indexOf("franky") > -1) {
      alert("your url contains the name franky");
    }
  });
</script>
Comment

check if string contains url

var reg = new RegExp('([a-zA-Zd]+://)?((w+:w+@)?([a-zA-Zd.-]+.[A-Za-z]{2,4})(:d+)?(/.*)?)', 'i')
if (reg.test(status_text)) {
    alert(reg.exec(status_text)[2]);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: Ready check failed: NOAUTH Authentication required. 
Javascript :: how to keep scrolling with javascript 
Javascript :: nuxt window is not defined 
Javascript :: detect touch react 
Javascript :: js order alphabetically 
Javascript :: get unchecked checkbox jquery 
Javascript :: javascript settimeout params 
Javascript :: how to pass token in laravel in jquery ajax 
Javascript :: jquery trigger link click 
Javascript :: nestjs Built-in HTTP exceptions 
Javascript :: joi enum validation 
Javascript :: vscode prettier use tabs 
Javascript :: js window redirect 
Javascript :: redirect the page in javascript 
Javascript :: node appendFile sync 
Javascript :: javascript MAX INT and MIN INT 
Javascript :: input change event in javascript 
Javascript :: props reactjs link 
Javascript :: how to edit /.prettierrc.json file pretter 
Javascript :: vue ref add class 
Javascript :: flutter text with icon 
Javascript :: new line in js 
Javascript :: get column from 2D array javascript 
Javascript :: disable input field using jquery 
Javascript :: jquery source disable right click 
Javascript :: js date subtract days 
Javascript :: object to query string js 
Javascript :: how to print an array in javascript 
Javascript :: get the value or text from select element using javaScript 
Javascript :: samesite cookie nodejs 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =