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]
2 years ago
8

How to Print output in JavaScript

Computers and Technology
1 answer:
katrin [286]2 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 action does not happen in each iteration of the repeat loop in the
iren2701 [21]

B. The number of sharks decreases. Explanation: hope it's help i learned about it and you too

7 0
2 years ago
The digital revolution has affected a. almost all areas of movie-making, except makeup and hairstyling. b. only a small number o
Georgia [21]

Answer:

Option D is correct.

Explanation:

The Digital Revolution applies to technological improvements from optical automated and mechanical machines to that of the digital technology that is currently accessible. The era began well into the year of 1980s, and continues. That Digital Revolution still marked as the start of the Era of Info.

  • It's the evolution of electrical and analog to digital technologies.
  • Its the advent of digital technologies has also altered the manner of people communication.
  • The following things are only done through computers, cellphones, as well as the web.
5 0
2 years ago
Beneficios del reciclaje electrónico
kykrilka [37]

English:

Recycling, in general, is good, it saves space in landfills and prevents pollution. Because some of the materials used to make the electronic piece are made with toxic ingredients its better to recycle them instead of having them end up in our oceans. Also, some pieces of electronics contain valuable metals like gold and copper. These Metals can be reused to make new better electronics with having to use the energy and money to produce new materials  

Español:

El reciclaje, en general, es bueno, ahorra espacio en los vertederos y evita la contaminación. Debido a que algunos de los materiales utilizados para fabricar la pieza electrónica están hechos con ingredientes tóxicos, es mejor reciclarlos en lugar de que terminen en nuestros océanos. Además, algunos componentes electrónicos contienen metales valiosos como el oro y el cobre. Estos metales se pueden reutilizar para fabricar nuevos y mejores productos electrónicos con la necesidad de utilizar la energía y el dinero para producir nuevos materiales.

4 0
3 years ago
How are devices connected to each other via Bluetooth? Choose two answers.
Olegator [25]

Answer:

Pairing and Passkey or PIN

Explanation:

8 0
3 years ago
Which function of a web page relies on responsive web design
navik [9.2K]

Answer:

Adding extra horizontal scroll, Blocking mobile devices from viewing, Eliminating extra links, Resizing content to fit a screen.

Explanation:

3 0
2 years ago
Other questions:
  • A typical serial cable has
    13·1 answer
  • What does CPL stand for
    9·2 answers
  • Fix the 2 error codes.
    14·1 answer
  • The calls radioed to patrol officers, or assignments given to police patrol units by 911 dispatchers, reveal the types of proble
    9·1 answer
  • Suppose the price of a complement to LCD televisions falls. What effect will this have on the market equilibrium for LCD​ TVs? T
    13·1 answer
  • Write an Enlistee class that keeps data attributes for the following pieces of information: • Enlistee name • Enlistee number Ne
    7·1 answer
  • Our readings so far explored computer hardware and software, in particular operating systems and application software. There are
    11·1 answer
  • How does recorded audio stay on an audio tape
    12·1 answer
  • This can change the fit of your respirator. A) A mustacheB) A beardC) Weight gainD) All of the above
    15·1 answer
  • Determine the value of a and b at the end of the following code segment:
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!