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
🌐
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. // … } In some cases, JavaScript is disabled or unavailable and window.open() will not work.
Discussions

How to open another HTML page using Javascript - Stack Overflow
I am working on a website and thought of reducing the number of pages by writing a bit of lines in javascript. I have a table on a page which leads you to 15 other pages. So I thought of opening on... More on stackoverflow.com
🌐 stackoverflow.com
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. More on stackoverflow.com
🌐 stackoverflow.com
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
javascript - Open a new HTML page in a JS function and then write some HTML on it - Stack Overflow
I have this main.html file which has a button of type "button". It has a create() function that processes the onclick event. I also have another page test.html which is in the same folder as the m... More on stackoverflow.com
🌐 stackoverflow.com
🌐
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.
🌐
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.
🌐
Educative
educative.io › answers › how-to-open-a-link-in-a-new-tab-with-html-and-javascript
How to open a link in a new tab with HTML and JavaScript
HTML’s target="_blank" is the simplest method to open links in a new tab, requiring no additional scripting. JavaScript provides dynamic control using window.open(), making it ideal for programmatically opening links in new tabs.
Find elsewhere
🌐
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></head> <body> <p> Click the button to open <b> geeksforgeeks.org </b> in 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?
Published   August 21, 2025
🌐
WebPlatform
webplatform.github.io › docs › tutorials › your_first_look_at_javascript
Your first look at JavaScript · WebPlatform Docs
To execute JavaScript in a browser you have two options — either put it inside a script element anywhere inside an HTML document, or put it inside an external JavaScript file (with a .js extension) and then reference that file inside the HTML document using an empty script element with a ...
🌐
GeeksforGeeks
geeksforgeeks.org › open-a-link-without-clicking-on-it-using-javascript
How to Open a Link Without Clicking on it using JavaScript? | GeeksforGeeks
October 3, 2024 - To open a link without clicking on it we can use the onmouseover method of JavaScript. The link will open when the mouse moves over the text. It returns a newly created window, or NULL if the call gets failed.
🌐
JavaScript.info
javascript.info › tutorial › frames and windows
Popups and window methods
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('/', 'example', 'width=300,height=300') newWindow.focus(); alert(newWindow.location.href); // (*) about:blank, loading hasn't started yet newWindow.onload = function() { let html = `<div style="font-size:30px">Welcome!</div>`; newWindow.document.body.insertAdjacentHTML('afterbegin', html); }; Please note: immediately after window.open, the new window isn’t loaded yet.
🌐
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..

🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › API › Document › open
Document: open() method - Web APIs - MDN Web Docs
The following simple code opens the document and replaces its content with a number of different HTML fragments, before closing it again.
🌐
Javascript-coder
javascript-coder.com › window-popup › javascript-window-open
Using the window.open method | JavaScript Coder
The Code below opens a popup window when you enter the page: <html> <head> <title>JavaScript Popup Example 3</title> </head> <script type="text/javascript"> function poponload() { testwindow = window.open("", "mywindow", "location=1,status=1,scrollbars=1,width=100,height=100"); testwindow.moveTo(0, ...
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Hello, world!
November 1, 2021 - JavaScript programs can be inserted almost anywhere into an HTML document using the <script> tag.