Skip to content

Instantly share code, notes, and snippets.

@websafe
Last active May 26, 2022 18:58
Show Gist options
  • Save websafe/421383d7fe3355e62b86ba78e177675d to your computer and use it in GitHub Desktop.
Save websafe/421383d7fe3355e62b86ba78e177675d to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Load url in hidden iframe</title>
<script
src="https://code.jquery.com/jquery-3.1.0.min.js"
integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s="
crossorigin="anonymous"
></script>
</head>
<body>
<ul>
<li><a href="#" class="noreload" rel="https://websafe.pl/">Click 1</a></li>
<li><a href="#" class="noreload" rel="http://locosp.dyndns.org/">Click 2</a></li>
<li><a href="#" class="noreload" rel="http://onet.pl/">Click 3</a></li>
</ul>
<iframe id="loader" style="width:0; height:0; border:0;"></iframe>
<script type="text/javascript">
$('.noreload').click(function(e){
$("#loader").attr("src", $(this).attr('rel'));
});
</script>
</body>
</html>
@mkvtvseries
Copy link

Hi How can I used in Wordpress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment