DIR : /home/kozerus/public_html/fetch.html
/home/kozerus/public_html
<script id="script_dispimg">
function dispimg(){
var imgtagf="<IMG alt='";
var imgtagm="Featured Pet' hspace=0 src='gallery/Featured";
var imgtagb=".JPG' size='medium' border=0>;";
var imgtag="";
if (testExists("gallery/Featured.JPG")) {
alert("file exists");
imgtag=imgtagf+imgtagm+imgtagb; }
else {
alert("file does not exist");
imgtag=imgtagf+"No "+imgtagm+"_None"+imgtagb; }
alert("returning "+imgtag);
return imgtag;
}
function testExists(imagepath) {
alert("running testExists");
req = getreq();
// the following alert never displays
alert("about to run imageExists");
req.onreadystatechange = imageExists();
req.open("head", imagepath, true);
req.send(null);
}
function imageExists() {
alert("running imageExists");
if(req.readyState == 4) {
if(req.status == 200) {
// image exists
nB=false;
}
else if(req.status==404) {
// image doesn't exist
nB=true;
}
else {
// all other error codes will set this
nB=null;
} alert("imageExists is "+nB);
return nB;
}
}
</script>
<script id="script_linkcheck" >
function Linkcheck(url) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.onload = function(e) {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
document.getElementById("frameSRC").src = newLink;
} else {
document.getElementById("frameSRC").src = "notFound.html";
}
}
};
xhr.send(null);
}
</script>
<script id="script_linkframe" >
function Linkframe(url) {
const http = new XMLHttpRequest();
http.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) { // if (HTML EXISTS)
document.getElementById("frameSRC").src = newLink;
} else {
document.getElementById("frameSRC").src = "notFound.html";
}
}
http.open('get', url, true);
http.send();
}
</script>
<script id="script_linkfetch" >
function Linkfheck(url) {
fetch(url).then(function(response) {
if (response.status === 200) {
document.getElementById("frameSRC").src = newLink;
} else {
// this else isn't needed but you can put it here or in the catch block
document.getElementById("frameSRC").src = "notFound.html";
}
})
.catch(function (err) {
throw err;
});
}
</script>
//
koh5_pano
Drag mouse to navigate.
Navigation
- Left/Right Mouse drag: Changes camera heading.
- Up/Sown Mouse drag: Changes camera pitch.
- Scroll wheel: Changes camera field of view.
- I-Key: Displays Info panel with canvas size, image size and FPS.
17.Aug.2010, Martin Wengenmayer