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
Discussions

javascript - Open a local HTML file using window.open in Chrome - Stack Overflow
This method will not work if we open then html though server. Only works when opening it as file:///D:/Examples/file1.html 2018-08-10T08:29:52.75Z+00:00 More on stackoverflow.com
๐ŸŒ stackoverflow.com
javascript - Open a new HTML page in a JS function and then write some HTML on it - Stack Overflow
However, do you want your string to be typed in an html input, or simply declared in the create function ? 2016-12-31T20:01:59.46Z+00:00 ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... Stack Overflow chat opening up to all users in January; Stack Exchange chat... Modernizing curation: A proposal for The Workshop and The Archive ยท 2 How can JavaScript ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How do you open HTML file in javascript? - Stack Overflow
So, firstly I'd like to specific that I'm aware of the following code window.open(url); which has worked very well for me in the past. The problem this time is that I'm trying to open a html fil... More on stackoverflow.com
๐ŸŒ stackoverflow.com
July 9, 2016
Open window in JavaScript with HTML inserted - Stack Overflow
How would I open a new window in JavaScript and insert HTML data instead of just linking to an HTML file? More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
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.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ HTML โ€บ How_to โ€บ Add_JavaScript_to_your_web_page
Add JavaScript to your web page - HTML | MDN
Take your webpages to the next level by harnessing JavaScript. Learn in this article how to trigger JavaScript right from your HTML documents.
๐ŸŒ
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.
Find elsewhere
๐ŸŒ
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.
๐ŸŒ
IQCode
iqcode.com โ€บ code โ€บ javascript โ€บ how-to-open-html-file-with-javascript
how to open html file with javascript Code Example
February 15, 2022 - // 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 ...
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 38283396 โ€บ how-do-you-open-html-file-in-javascript
How do you open HTML file in javascript? - Stack Overflow
July 9, 2016 - 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.
๐ŸŒ
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.
๐ŸŒ
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: ...
๐ŸŒ
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.
๐ŸŒ
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)
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ html-javascript
HTML JavaScript - GeeksforGeeks
January 17, 2026 - 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>
๐ŸŒ
JavaScript.info
javascript.info โ€บ tutorial โ€บ the javascript language โ€บ javascript fundamentals
Hello, world!
November 1, 2021 - 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.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnprogramming โ€บ how can i open an html page with javascript in it?
r/learnprogramming on Reddit: How can I open an HTML page with javascript in it?
October 16, 2022 -

Hello all !

I tried to open the index.html of a folder containing HTML and Javascript.

When I double click on the index.html, it's just a blank page.

What am I missing pls ?

Thank you so much !

In the HTML there is:

<html> <head> <title>My First Web Page</title> <script src="myComponents/index.js" type="module"></script> </head> <body> <my-audio src="https://alinkofsound.mp3"> </my-audio> </body> </html>

In my component folder, there is a javascript folder containing different elements to have the page do this.
The issue is that it works in codepenio..

๐ŸŒ
JavaScript.info
javascript.info โ€บ tutorial โ€บ frames and windows
Popups and window methods
November 4, 2022 - In this example, we generate popup content from JavaScript: let newWin = window.open("about:blank", "hello", "width=200,height=200"); newWin.document.write("Hello, world!"); And here we modify the contents after loading: let newWindow = open('/', ...