Moved all javascript to the bottom (good practice)
This commit is contained in:
parent
3fa867812f
commit
466145f389
1 changed files with 15 additions and 15 deletions
|
@ -73,6 +73,8 @@ else $prevPageUrl = dirname($_SERVER["REQUEST_URI"])."/$prevImage";
|
||||||
|
|
||||||
$directoryUrl = "$bizouRootUrl/index.php".dirname($simpleImagePath);
|
$directoryUrl = "$bizouRootUrl/index.php".dirname($simpleImagePath);
|
||||||
|
|
||||||
|
$firefox = strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false;
|
||||||
|
|
||||||
header('Content-Type: text/html; charset=utf-8');
|
header('Content-Type: text/html; charset=utf-8');
|
||||||
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
|
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
|
||||||
?>
|
?>
|
||||||
|
@ -121,22 +123,9 @@ img {
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<?php if ($nextImageUrl !== '') { ?>
|
<?php if ($nextImageUrl !== '' and $firefox) { ?>
|
||||||
<?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) { ?>
|
|
||||||
<link rel="prefetch" href="<?php echo $nextImageUrl ?>" />
|
<link rel="prefetch" href="<?php echo $nextImageUrl ?>" />
|
||||||
<link rel="prefetch" href="<?php echo $nextPageUrl ?>" />
|
<link rel="prefetch" href="<?php echo $nextPageUrl ?>" />
|
||||||
|
|
||||||
<?php } else { ?>
|
|
||||||
<script type="text/javascript">
|
|
||||||
window.onload = function() {
|
|
||||||
var im = new Image();
|
|
||||||
im.src = '<?php echo $nextImageUrl ?>';
|
|
||||||
var req = new XMLHttpRequest();
|
|
||||||
req.open('GET', '<?php echo $nextPageUrl ?>', false);
|
|
||||||
req.send(null);
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<?php } ?>
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
@ -160,7 +149,18 @@ window.onload = function() {
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<script language="javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
<?php if ($nextImageUrl !== '' and ! $firefox) { ?>
|
||||||
|
window.onload = function() { // for browsers not supporting link rel=prefetch
|
||||||
|
var im = new Image();
|
||||||
|
im.src = '<?php echo $nextImageUrl ?>';
|
||||||
|
var req = new XMLHttpRequest();
|
||||||
|
req.open('GET', '<?php echo $nextPageUrl ?>', false);
|
||||||
|
req.send(null);
|
||||||
|
};
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
// keyboard navigation
|
// keyboard navigation
|
||||||
function keyup(e)
|
function keyup(e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue