lots of way possible ..

1.

<script language="javascript" type="text/javascript">
    window.location.href="login.jsp?backurl="+window.location.href;
</script>

2.

<script language="javascript">
    alert("back");
    window.history.back(-1);
</script>

3.

<script language="javascript">
    window.navigate("top.jsp");
</script>

4.

<script language="JavaScript">
    self.location="top.htm";
</script>

5.

<script language="javascript">
    alert("Access Violation");
    top.location="error.jsp";
</script>

6.

<script language="javascript">
    window.location = window.location.host;
</script>
Answer from Govind Singh on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ met_doc_open.asp
HTML DOM Document open() Method
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_scripts.asp
HTML JavaScript
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ API โ€บ Window โ€บ open
Window: open() method - Web APIs | MDN
... const windowFeatures = "left=100,top=100,width=320,height=320"; const handle = window.open( "https://www.mozilla.org/", "mozillaWindow", windowFeatures, ); if (!handle) { // The window wasn't allowed to open // This is likely caused by built-in popup blockers.
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_whereto.asp
JavaScript Where To
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
Find elsewhere
๐ŸŒ
IQCode
iqcode.com โ€บ code โ€บ javascript โ€บ how-to-open-html-file-with-javascript
how to open html file with javascript Code Example
// In my case, I used a button to activate this function: function myFunction() { window.location.href = 'index.html'; } ... Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond. Sign up ยท Develop soft skills on BrainApps Complete the IQ Test ... open ...
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ met_win_open.asp
Window open() Method
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 38283396 โ€บ how-do-you-open-html-file-in-javascript
How do you open HTML file in javascript? - Stack Overflow
window.open("http://coynesresources.weebly.com/uploads/7/6/5/3/76537449/small.html", "windowName", "width=200,height=100",false); ... It had the same effect except that a small window was opened up briefly beforehand.
๐ŸŒ
JavaScript.info
javascript.info โ€บ tutorial โ€บ the javascript language โ€บ javascript fundamentals
Hello, world!
Create a page that shows a message โ€œIโ€™m JavaScript!โ€. Do it in a sandbox, or on your hard drive, doesnโ€™t matter, just ensure that it works. ... Open the solution in a sandbox.
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_examples.asp
JavaScript Examples
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ how-to-open-url-in-a-new-window-using-javascript
How to open URL in a new window using JavaScript? - GeeksforGeeks
August 21, 2025 - The other parameters can be varied ... function to open a new window. ... <!DOCTYPE html> <html> <head> <title> Click the button to open a new window....
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ javascript-window-open-method
JavaScript window.open() Method - GeeksforGeeks
August 5, 2025 - Example 1: In this example, we will open a new window on a button click with the specified parameters. ... <!DOCTYPE html> <head> <style> body { background-color: #272727; display: flex; justify-content: center; align-items: center; margin-top: ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ html-javascript
HTML JavaScript - GeeksforGeeks
January 18, 2024 - The browser executes the JavaScript when the page loads. This enables features like button clicks, dynamic content, and animations. ... <!DOCTYPE html> <html> <head> <title>Script Tag Example</title> </head> <body> <p>Open the console to see the message.</p> <script> console.log("Hello from JavaScript!"); </script> </body> </html>
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ how-to-open-url-in-new-tab-using-javascript
How to Open URL in New Tab using JavaScript? - GeeksforGeeks
<html> <head> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; font-family: Arial, sans-serif; } button { padding: 10px 20px; font-size: 16px; cursor: pointer; } </style> </head> <body> <p>Click the button to open <b>GeeksforGeeks</b> in a new tab:</p> <button onclick="NewTab()">Open GeeksforGeeks</button> <script> function NewTab() { window.open("https://www.geeksforgeeks.org////", "_blank"); } </script> </body> </html> Output ยท How to Open URL in New Tab using JavaScript? In this example ยท
Published ย  August 21, 2025
๐ŸŒ
Programiz
programiz.com โ€บ html โ€บ html-and-javascript
HTML and Javascript (With Examples)
Javascript is used to add interaction to HTML pages. Javascript, also known as JS, is a programming language used for the web development. It is used to make HTML pages more interactive, and dynamic. For example, function speak() { alert('Hello') } Click Me Browser output (before click)
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ how-to-add-javascript-to-html
How to Add JavaScript to HTML for Beginners | DigitalOcean
July 14, 2025 - Learn how to add JavaScript to HTML using script tags, inline code, and external files. Follow step-by-step examples.