Added prefetch support trick for non Firefox browsers
This commit is contained in:
parent
3c6fb594a9
commit
3287102a85
1 changed files with 13 additions and 0 deletions
13
view.php
13
view.php
|
@ -112,8 +112,21 @@ img {
|
|||
</style>
|
||||
|
||||
<?php if ($nextImageUrl !== '') { ?>
|
||||
<?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) { ?>
|
||||
<link rel="prefetch" href="<?php echo $nextImageUrl ?>" />
|
||||
<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 } ?>
|
||||
|
||||
</head>
|
||||
|
|
Loading…
Reference in a new issue