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
A Game Object must have a Transform<br><br> True<br><br> False
vovikov84 [41]

Answer:

Yes

Explanation:because,have to update there apps or games and change there characters

3 0
3 years ago
Difference between customized and packaged software​
docker41 [41]

Packaged software is a compilation of programs which are grouped together in order to provide publicly with different tools in the same group.

Custom software is a specific program that are advanced for a goal in a department or in a company.

5 0
2 years ago
Are all the computer users known as programmer ​
Evgesh-ka [11]

Answer:

Nope

Explanation:

programmers are diff

6 0
2 years ago
How is an operating system like a translator?
emmasim [6.3K]

Answer:

Operating systems work like translators because they are able to take software and hardware, and put it all together to work in a way that is readable and usable for the consumer.

5 0
3 years ago
Clicking on the sheet tab with the _______ adds another worksheet to an Excel file.
alekssr [168]
Circled plus sign adds another worksheet
7 0
3 years ago
Other questions:
  • How do open online courses help with independent learning? (1 point)
    13·2 answers
  • Your organization will be handling market trades. You will be required to verify the identify of each customer who is executing
    8·1 answer
  • You are adding a new 500 GB hard drive to your computer. The hard drive must be formatted with a file system to organize files i
    8·1 answer
  • Which technology has the potential to be misused to make atomic bombs? A. computer technology B. nuclear technology C. medical t
    14·1 answer
  • Data are sent through a network on bundles called _______. select one:
    8·2 answers
  • What steps will add content to a report header section?
    5·2 answers
  • 1) SuperFetch is a memory-management technique that a) determines the type of RAM your system requires. b) makes the boot-up tim
    7·1 answer
  • What is the difference of using Selection Tool and Direct Selection Tool?
    6·1 answer
  • Pls say correct guyz pls pls pls
    7·1 answer
  • PLEASE HELP WILL MARK BRAINLIEST
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!