js changes the Src approach in Iframe

  • 2020-06-07 03:56:44
  • OfStack

This article illustrates how js can change Src in Iframe. Share to everybody for everybody reference. Specific implementation methods are as follows:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" 
content="http://schemas.microsoft.com/intellisense/ie5">
<script type="text/javascript">
function test(Url)
{
document.frames[0].location.href =Url; 
}
</script>
</head>
<body>
<iframe id="xx" src=""></iframe>
<a onclick="test('top.html')" href="#">linkbutton</a>
</body>
</html>

Hopefully, this article has been helpful in your javascript programming.


Related articles: