Answers for "check url exists"

0

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>
Posted by: Guest on June-01-2020
0

excel check if url exists

Function Test_URLExists()
  Dim url As String
  
  url = "http://www.mrexcel.com/forum/showthread.php?t=567315"
  MsgBox url, vbInformation, URLExists(url)
  
  url = "http://xwww.mrexcel.com/forum/showthread.php?t=567315"
  MsgBox url, vbInformation, URLExists(url)
End Function

Function URLExists(url As String) As Boolean
    Dim Request As Object
    Dim ff As Integer
    Dim rc As Variant
    
    On Error GoTo EndNow
    Set Request = CreateObject("WinHttp.WinHttpRequest.5.1")
    
    With Request
      .Open "GET", url, False
      .Send
      rc = .StatusText
    End With
    Set Request = Nothing
    If rc = "OK" Then URLExists = True
    
    Exit Function
EndNow:
End Function
Posted by: Guest on May-27-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language