I got to thinking (first mistake) 'there must be a way to make this more widely applicable'. I came up with this set of scripts that should behave pretty well no matter the browser (as long as it supports iframes) and as long as the two variables at the top are correctly set.
HTML Code:
<html>
<head>
<title>Dir Display - Demo</title>
</head>
<script type="text/javascript">
///////////////////////////////
//Directory Display Script
//Copyright © John Davenport Scheuer
//Permission to use granted
//This credit must remain
///////////////////////////////
//Set Use -
//ielocal for viewing a directory that will display in Windows default explorer mode
//other for all others
var Use = 'ielocal';
//Set Directory to be displayed
var dir = '//c:/networkshortcuts/'
//////////////No Need to Edit Below Here/////////////
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;
if ((typeof(window.onresize))==('object')||('undefined'))
window.onresize=refresh;
function refresh() {
setTimeout("doit()",1)
}
function doit(){
if (window.location.reload)
window.location.reload( true );
else if (window.location.replace)
window.location.replace(unescape(location.href))
else
window.location.href=unescape(location.href)
}
</script>
<body style="overflow:hidden">
<script type="text/javascript">
if (ns6||ie4){
function winWid(){ return (ns6) ? window.innerWidth:document.body.clientWidth; }
var width=winWid();
var left=0;
if(ie4&&(Use=='ielocal')){
width+=210;
left-=210;
}
document.write('<iframe style="position:absolute;top:0;left:'+left+'px;" src="'+dir+'" width="'+width+'" height="100%" scrolling="auto" frameborder="0">Unsupported Browser</iframe>')
}
else
document.write('Unsupported Browser')
</script>
</body>
</html>
Bookmarks