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 :: react sass 
Javascript :: Set CSS styles with javascript 
Javascript :: usesearchparams react router 
Javascript :: in javascript pass infinite argument in function 
Javascript :: how to make a delete button in javascript 
Javascript :: why we import react from react 
Javascript :: jquery datatable 
Javascript :: javascript operators 
Javascript :: how to remove an item from an object in javascript 
Javascript :: firebase realtime database increment value 
Javascript :: nodejs debug 
Javascript :: javascript how to select a array 
Javascript :: create react tailwind app 
Javascript :: simulate mouse click javascript 
Javascript :: what are undeclared and undefined variables in javascript 
Javascript :: javascript number() method 
Javascript :: javscript async function 
Javascript :: button is not calling js function 
Javascript :: save image on cloudinary 
Javascript :: Material-ui add circle icon 
Javascript :: days.js 
Javascript :: regex javascript matching first letter to last 
Javascript :: how can we access the data from array object in javascript 
Javascript :: javascript sucks 
Javascript :: function syntax js 
Javascript :: Looping arrays with for loop 
Javascript :: how to create a search engine with javascript 
Javascript :: undefined behavior: the order of volatile accesses is undefined in this statement 
Python :: All caps alphabet as list 
Python :: conda install ffmpeg 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =