PageSourceSearch

https://greatermanchester.ac.uk/UoB/js/doesItExist.js

js greatermanchester.ac.uk collected 2026-09-24 10:12:31 UTC 816 bytes, 37 lines download raw bytes

1// This check if a video file exists 
2function doesFileExist(urlToFile) {
3    var xhr = new XMLHttpRequest();
4    xhr.open('HEAD', urlToFile, false);
5    xhr.send();
6     
7    if (xhr.status == "404") {
8        return false;
9    } else {
10        return true;
11    }
12}
13
14// var result = doesFileExist("www.urlOfSomeVideo.com/video.mp4");
15// if (result == true) {
16//     $(this).hide();
17
18    
19//     // file exists!
20//     // display the video
21// } else {
22//     // file does not exist!
23//     // display the image
24
25// }
26
27// this checks if there is a video hidden on the page
28// if the hidden is there then it and hide the image
29
30if ($('#doesYoutubeVideoExists')){
31    $('.heroImageExists').hide()
32    $('#doesHtmlVideoExists').hide()
33    $('#doesYoutubeVideoExists').show()
34} else {
35    $('.heroImageExists').show()
36}
37

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.