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
This is an example of what type of formula?
Dimas [21]

Answer:

Subtraction

Explanation:

That is subtracting the values of two cells.

You know because of the "-" sign

4 0
2 years ago
How many shared keys are required for a company of 70 employees who all need to communicate securely with each other?
kiruha [24]
I Think The Answer Would Be B Or D

7 0
2 years ago
Keith has to carry out a photo shoot to capture images of the ocean during the monsoons. What is a recommended practice when sho
Semmy [17]

Answer:

Answer is A: place absorbent chemical packets in the camera cover

Explanation:

Keith is required to carry adequate gear while going for a shoot. And in this case, he should carry anything that will protect his camera from the ocean and rainwater. By anything, I mean anything that Keith will use to stay dry. Using an air conditioner would be the worst idea. An air conditioner might blow the air towards your camera. Placing the camera in its case will ensure that it is dry and Keith will keep on shooting. Placing absorbent chemical packets in the camera cover will ensure that any water droplets that might fall on the cover of the camera will be absorbed. The point here is to keep dry.

6 0
3 years ago
Differences between barcode reader and character recognition devices​
spin [16.1K]

<u><em>Differences between barcode reader and character recognition devices​:</em></u>

Barcode Reader or Barcode Scanner:  

  • Barcode Scanner scans the data by brightening the barcodes usingSensor
  • The analog signal is then converted into digital signal by Converter.
  • The Decoder calculates the converted data and sends valid data to the computer.  

Character Recognition Devices (OCR):

  • OCR scans the physical document and converts them into two-coloured format.
  • The darker and lighter area are identified as characters and blanks respectively.
  • The common methods used are: Pattern Recognition and Feature Detection.

3 0
3 years ago
Read 2 more answers
Change the function definition for myint so that xyzfunc uses the same memory locations for myint as in the calling program.
sattari [20]

Answer:

b) void xyzfunc (int &myint);

Explanation:

To use the same memory location as the variable in the calling function we have to pass the variable by reference means passing the same address to the function.So to do that we have use & operator which stands for address.

We will do this as following:-

void xyzfunc (int * myint);

Hence the answer is option b.

8 0
3 years ago
Other questions:
  • All java classes must contain a main method which is the first method executed when the java class is called upon.
    10·1 answer
  • What is a good way to minimize technical problems with your computer
    10·1 answer
  • In order to organize your work effectively on the computer, where is the best place to save it?
    14·2 answers
  • Which property of a text element controls how the browser handles text that does not fit within the element box?
    13·1 answer
  • Complete the method, print Multiples(), that takes in a positive integer n, and another positive integer, max. Print out all the
    15·1 answer
  • Please help ASAP!
    15·1 answer
  • SummaryIn this lab, you complete a partially written C++ program that includes a function named multiplyNumbers() that multiplie
    13·1 answer
  • Can someone help me so I don’t fail this class:(
    14·1 answer
  • In C language. Print numbers 0, 1, 2, ..., userNum as shown, with each number indented by that number of spaces. For each printe
    5·1 answer
  • A message is sent to all hosts on a remote network. Which type of message is it?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!