Automatiaclly crop website before printing the page [duplicate] - javascript

This question already has answers here:
remove url and print text from the printed page
(4 answers)
Closed 7 years ago.
I have a HTML file that triggers print() when you click a button. How do you crop the page so the site name and url does not show up?

You cant, including URL and/or title is up to the browsers print dialog.

Related

How to prevent the user from leaving my page [duplicate]

This question already has answers here:
Prevent a webpage from navigating away using JavaScript
(10 answers)
Prevent user to leave my page in javascript
(2 answers)
Closed 4 years ago.
I'm trying to make an online test using spring-mvc and html, css, jquery and I want to prevent the user that is doing the test from leave the test screen while doing the test. Does anybody know how I can do that?

How to launch a local .html file as a pop-up? [duplicate]

This question already has answers here:
Open a local HTML file using window.open in Chrome
(3 answers)
Closed 4 years ago.
I am wondering what I can add to make an .html or .htm file create a pop-up window instead of creating a normal window and load the content in that window. Is there a way to do this? I have no idea, thanks.
link text
target="_blank" makes the link open in a new window, now a new tab

how to open external url in new tab in laravel [duplicate]

This question already has answers here:
How to open link in a new tab in HTML?
(12 answers)
Closed 5 years ago.
I opened the external URL using javascript. But it opens in the same window I need to open it in new tab
onclick="window.location= '$url';
You can do it by using only html if you want :
some text
But by javascript this should work :
onclick="window.open('http://my.link.com', '_blank')"

How to open a tab and display text in blank page [duplicate]

This question already has answers here:
Open window in JavaScript with HTML inserted
(8 answers)
Closed 7 years ago.
When the user click somewhere, I want the browser to open a new tab and display the text I want him to.
I want something exactly like a link with a blank target to a text file on my server, except that the text is generated on the client side by my script, so no interaction with the server.
Assuming that you are just looking to display text in a file. You can build a string with Javascript and then open a new window with that code below.
Please note, that popup blockers do not like window.open.
var str = 'hello world';
window.open('data:text/plain;charset=utf-8,' + str);

How does the URL change without refreshing the page? [duplicate]

This question already has answers here:
Change the URL in the browser without loading the new page using JavaScript
(14 answers)
Closed 8 years ago.
The URL on this page seems to change when I click in the comments section where it says "x More...".
How this this URL trickery happen?
It is part of the HTML5 history api.

Categories

Resources