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.
🌐
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 › 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.
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › javascript fundamentals
Hello, world!
If we have a lot of JavaScript code, we can put it into a separate file. Script files are attached to HTML with the src attribute:
Find elsewhere
🌐
W3Schools
w3schools.com › jsref › met_win_open.asp
Window open() Method
Animation Events Clipboard Events Drag Events Events Focus Events HashChange Events Input Events Keyboard Events Mouse Events PageTransition Events PopState Events Progress Events Storage Events Touch Events Transition Events Ui Events Wheel Events HTML Event Properties · altKey (Mouse) altKey (Key) animationName bubbles button buttons cancelable charCode clientX clientY code ctrlKey (Mouse) ctrlKey (Key) currentTarget data defaultPrevented deltaX deltaY deltaZ deltaMode detail elapsedTime elapsedTime eventPhase inputType isTrusted key keyCode location metaKey (Mouse) metaKey (Key) newURL oldURL offsetX offsetY pageX pageY persisted propertyName relatedTarget relatedTarget screenX screenY shiftKey (Mouse) shiftKey (Key) target targetTouches timeStamp touches type which (Mouse) which (Key) view HTML Event Methods
🌐
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 ...
🌐
SitePoint
sitepoint.com › javascript
JavaScript Button cannot open another html file. Why? - JavaScript - SitePoint Forums | Web Development & Design Community
June 28, 2009 - Hello all, I am trying to set up an onclick function in Javascript that opens another html file. Below there are a few examples of the code used and the error messages they received. Please note that it must be a button not a hyperlink and also it needs to be the genuine file that opens not ...
🌐
Stack Overflow
stackoverflow.com › questions › 38283396 › how-do-you-open-html-file-in-javascript
How do you open HTML file in javascript? - Stack Overflow
It had the same effect except that a small window was opened up briefly beforehand. ... You can't use direct ajax query for this url (crossdomain policy). So you must use proxy with jsonp. See: Loading cross domain endpoint with jQuery AJAX · And working example for you: http://jsbin.com/bahigodiru/1/edit?html,js,output
🌐
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
Within a browser, JavaScript doesn't do anything by itself. You run JavaScript from inside your HTML webpages. To call JavaScript code from within HTML, you need the <script> element.
🌐
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.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-add-javascript-to-html
How to Add JavaScript to HTML for Beginners | DigitalOcean
July 14, 2025 - The <script> tag can be placed in the <head> section of your HTML or in the <body> section, depending on when you want the JavaScript to load. Generally, JavaScript code can go inside the document <head> section in order to keep it contained and out of the main content of your HTML document.
🌐
Simmons University
web.simmons.edu › ~grabiner › comm244 › weeknine › including-javascript.html
Including JavaScript In Your Page
Here's a very simple demonstration of how to include an external JavaScript file into an HTML page. ... For this class you are not expected to write any actual JavaScript code.
🌐
W3Schools
w3schools.com › js › js_whereto.asp
JavaScript Where To
Old JavaScript examples may use a type attribute: <script type="text/javascript">. The type attribute is not required. JavaScript is the default scripting language in HTML. A JavaScript function is a block of JavaScript code, that can be executed when "called" for.
🌐
Computer Hope
computerhope.com › issues › ch002254.htm
How to View JavaScript for a Web Page
Using either method above, the HTML source code is displayed. To find inline JavaScript code, look for a <script type="text/javascript"> tag, denoting the start of the JavaScript.
🌐
Reddit
reddit.com › r/web_design › beginner: why can't i just click on an html file and load the js code and test an app that way in the browser? why is a local server needed?
r/web_design on Reddit: Beginner: Why can't I just click on an HTML file and load the js code and test an app that way in the browser? Why is a local server needed?
February 15, 2022 -

I'm starting to question everything and want to finally understand stuff on a deeper level. So I'll start asking dumb questions.

My browser blocks the js code due to CORS. How could I allow it to run the js code? I want to understand step by step how we go from HTML and js code to a full web app. I want to understand each step, including bundlers and all of that.

Thanks for any suggestions.

🌐
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.