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
There is no way to track your smartphone once you lost it, true or false?
Ymorist [56]
If you originally had a tracking device installed on a different device like find my iPhone, you can easily see where it is. If your phone is Android, Google has a system where you can search where's my phone, and if you have your email login into your phone, you can log in on Google and Google will show you where it is. 
6 0
3 years ago
Read 2 more answers
NEED HELP NOW 66 POINTS WILL MARK BRAINLIEST!! For the independent reading all you have to do is pick a grade six book that you
nlexa [21]
1a
2a
3b
4d
5c
6d
7b
8c
9a
10c
6 0
3 years ago
Select the correct answer Steven has been assigned a task to lead a team to analyze volumes of financial data Steven observes th
Alborosie

Answer:

The correct answer is B. Take periodic breaks and alternate between tasks.

Explanation:

This question is incomplete, the complete questions is this:

Select the correct answer Steven has been assigned a task to lead a team to analyze volumes of financial data Steven observes that his team members work for long hours he wants to help his team members to follow useful work habits increase work efficiently and avoid health issues what should Stephen advised his team to do.

A. Avoid taking breaks during work and work continuously.  

B. Take periodic breaks and alternate between tasks.  

C. Avoid sitting upright on chairs when experiencing physical fatigue.

D. Use cushions and small pillows below the computers to adjust their heights.  

E. Close curtains, blinds, and overhead lights to reduce eye fatigue.

In this case we need to take periodic breaks, in this way we will have more energy to keep working.

If we avoid breaks, we're going to be stressed out.

Always must sit upright on chairs to avoid physical fatigue.

Use cushions and small pillows are not necessary just sit upright on chairs.

We need to have a good natural illumination to reduce eye fatigue.

8 0
3 years ago
Do my Twitter posts count as opinions or facts?
elena55 [62]
They count as opinions
6 0
2 years ago
Read 2 more answers
WHAT DO YOU KNOW?<br> Why would you want to change your Table<br> Properties?
joja [24]

read the slides ;  Table Properties are the way the table appears or looks.

6 0
2 years ago
Other questions:
  • You can click a web page title on the _____ list to return to that page.
    10·1 answer
  • Data hiding, which means that critical data stored inside the object is protected from code outside the object, is accomplished
    14·2 answers
  • Examples of apps include pop-up windows, validation of webform inpts and images that change when a cursor passes over them
    12·1 answer
  • RFID tags uses memory that is read-only.A. TrueB. False
    5·1 answer
  • Hurry please
    12·1 answer
  • It is necessary tto save updates often when working in google docs? True or false
    11·2 answers
  • Rain forests clean the air by producing oxygen. Some rain forest plants have healing properties, and can be used as medicine. Ra
    12·1 answer
  • For current events, what type of sources would we use to learn about them?
    14·1 answer
  • Why should running your unit test suites not take a long time?A. Unit tests aren't that important, so less time should be spent
    5·1 answer
  • Which of the expressions is false? when a = 10 and b = 4
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!