1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vera_Pavlovna [14]
3 years ago
8

How to Print output in JavaScript

Computers and Technology
1 answer:
katrin [286]3 years ago
8 0

If you want to print on a page you can use

document.write();

If you want to write in console then there are multiple options

console.log() - to log information

console.error();- to log errors

console.warn(); - to log warning message

If you want to popup some information the you can use -

alert(message);

there are also various options present in alert.

or

print() essentially just calls up the native print dialog for a given window.

But as you're are thinking, it will work on any window or (i)frame.

thus if you write content to a frame, you can then call this to print it.

window.frameName.print();

note the only drawback (and its a big one), is that this calls up the print dialog... not the print preview window... thus the user doesn't really get a chance to see what they are printing and/or scale it to fit their printer/paper.

I personally wish that all browsers would implement the following to handle the above issue.

window.printPreview();

Hope this will help !!!

You might be interested in
Which function of InfoSec management encompasses security personnel as well as aspects of the SETA program?
inessss [21]

Answer:

People

Explanation:

Information security management provides a description of the controls needed by an organization in order to ensure that it is capable of protecting the integrity, availability, and confidentiality of assets from security vulnerability and threats. On the other hand, the SETA program is three phased and ensures that organizations address and implement training and techniques for information security. Hence the only function that encompasses security personnel as well as aspects of the SETA program is the People function.

8 0
4 years ago
In a weighted scoring model, the sum of the weights of all the criteria must total _____ percent.
REY [17]
The answer is 100% ...
3 0
4 years ago
What should you do in order to have access to the header and footer tools? Open the View tab. Open the Page Setup dialog box. Op
Svetach [21]

Answer:

Step 1  - Open the View tab.

Step 2 - Open the Page Setup dialog box

Step 3 - Open the header and footer tool.

Step 4 - Click OK.

Explanation:

In order to access to the header and footer tools

Step 1  - Open the View tab.

Step 2 - Open the Page Setup dialog box

Step 3 - Open the header and footer tool.

Step 4 - Click OK.

4 0
3 years ago
What is the value of 25 x 103 = ________?
ira [324]

Answer:

2575

heres coorect

6 0
3 years ago
Read 2 more answers
If I put a short clip from a copyrighted video to Facebook and make it only viewable to friends, is that illegal?
nirvana33 [79]
No thats not illegal, because it is a copyright. And this is not for school.XD
7 0
4 years ago
Other questions:
  • What are technology trends in science check all that apply
    13·1 answer
  • Mary needs to choose the _____ menu in order to place the text in a desirable fashion around the image
    12·2 answers
  • Consider the following declaration.int[] beta = new int[3];int j;Which of the following input statements correctly input values
    11·1 answer
  • Rerouting traffic using arp poisoning is an attack on ________ of a network.
    8·1 answer
  • CODE EXAMPLE 3-1 SELECT vendorName, invoiceNumber, invoiceDate, invoiceTotal FROM vendors INNER JOIN invoices ON vendors .vendor
    13·1 answer
  • A developer has been asked to create code that will meet the following requirements: Receives input of: Map, List Performs a pot
    13·1 answer
  • In powerpoint a point is _____ of an inch in height.
    6·1 answer
  • What is the decrypted binary
    9·1 answer
  • Legends are titles given to three-axis X, Y, and Z-axis. True or false?
    6·1 answer
  • Does anyone know how to permanently delete photos on a dell computer? For my cousin.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!