I have a file (not txt) and want to open this file without the need of the user to click

Asked

Viewed 40 times

1

I’m a beginner and I’m having second thoughts. Follow an example of how I want it to be:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
   <!-- Como fazer esse link abrir sem necessidade do usuário clicar?-->
    <a href="launch.jnlp">Clique</a>

</body>

  • You want the browser to automatically go to another page or you want to open a new window/tab with that link?

  • Boy, this jnlp is a java web start. has an applet attached there

  • By clicking it opens outside the browser does not need to be in the browser, this will open a new page.

1 answer

3


If you want to open the link in a new tab, although you are a beginner, you can choose to Javascript , follows a practical example:

function OpenInNewTab(url) {
var win = window.open(url, '_blank');
win.focus();
}

In the code HTML we’ll just put:

<body onload=OpenInNewtab('http.....')>
.......
</body>
  • Yes, I forgot to say I want to do this with javascript

  • It worked out here. You guys know a lot

  • 1

    Any doubt dispose :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.