Placing the following JavaScript code in a web page will cause it to automatically redirect to the address provided in the code.

 

If you need to redirect the parent page of an iframe you could use something like the following code.

 

What is JavaScript?
JavaScript, often dubbed the “language of the web,” is a dynamic scripting language that brings interactivity and dynamism to websites. As a cornerstone of modern web development, JavaScript enables developers to create captivating user experiences by adding real-time interactions, animations, and dynamic content without the need for constant page reloading. From enhancing user interfaces to enabling complex web applications, JavaScript’s versatility and ubiquity have firmly established it as an essential tool for crafting the interactive digital landscape we navigate daily.