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
What division monitors the sale and registration of vehicles and vessels within the state?
Semmy [17]
The Division of Motor Vehicles monitors the sale and registration of vehicles and vessels within the state.Hope this helps:)
5 0
3 years ago
What is the page table mainly for?
postnew [5]

Answer: See explanation

Explanation:

A page table is used for the tracking and the location of different pages of a task in memory. It helps in showing the mapping of locations between the physical addresses and the virtual addresses.

A page table stores also has the page table entries and this is where the frame numbers are stored as well as the operational status.

6 0
3 years ago
Charlie makes pizza at a restaurant. The customers always compliment how great the pizza tastes. But Charlie takes a long time t
Oksi-84 [34.3K]
To get this u must do 8372928+(2728279298)=382627-6382638)()()(7372637 I did it right I’m the test
8 0
3 years ago
Read 2 more answers
Write an application that encodes English-language phrases into pig Latin. Pig Latin is a form of coded language. There are many
deff fn [24]

Answer:

Answer has been attached to this response as a source code file saved as "PigLatinWord.java"

Explanation:

Explanation has been added to the source code in the form of comments. Please go through the comments in the code.

Hope this helps!

Download java
3 0
4 years ago
Which is a primary document?<br> a. letter<br> b. dictionary<br> c. textbook<br> d. website
just olya [345]
Its B because a primary document means something with a <span>source or evidence</span> that gives u a lot of information.
6 0
3 years ago
Other questions:
  • Input _____ is a template or pattern that restricts data entry and prevents errors.
    7·1 answer
  • What term refers to a piece of software that interfaces with the hardware on your computer?
    10·2 answers
  • How do I only give 5 points and not 10?
    7·1 answer
  • Inherent flaws in system software code are called:
    7·1 answer
  • Write a Java program to accept an item's name and price from the user and output them to the console
    5·1 answer
  • Gear systems with __________ can have both drive and driven gears on the same shaft. a. an odd number of gears b. an even number
    6·1 answer
  • To add text to a slide when using presentation software, you need to add a text box. To add a text box, click the Text Box butto
    8·2 answers
  • How can I get more views on my you tube channel "Braeden Eischen" without paying anything
    5·1 answer
  • Using the simple alphabet code below, you will decode and encode the message. Write the Full
    6·1 answer
  • Tyler is feeling overwhelmed by the programming assignment from his supervisor and wants to break the task down into smaller, mo
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!