Skip to content

Instantly share code, notes, and snippets.

@zmmbreeze
Created January 27, 2016 12:00
Show Gist options
  • Save zmmbreeze/6b29fc71bd6e5e2c96af to your computer and use it in GitHub Desktop.
Save zmmbreeze/6b29fc71bd6e5e2c96af to your computer and use it in GitHub Desktop.
redirect
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>跳转中...</title>
</head>
<body>
<script>
(function(url) {
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
var referLink = document.createElement('a');
referLink.href = url;
document.body.appendChild(referLink);
referLink.click();
}
else {
location.href = url;
}
})('{query.to}');
</script>
<noscript>
如果没有自动跳转,请点击<a href="{query.to}">此地址跳转</a>
</noscript>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment