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 device that is connected to the Internet is known as<br> a. Nexus. Backbone. Node. Link.
ikadub [295]
A device connected to the internet is known as a Node.
3 0
2 years ago
Read 2 more answers
Cuando, Quien, Donde y Como empieza a funcionar Amazon?
vlabodo [156]

Answer:

It started working in July 16,1995. Mr Jeff Benzos was the founder of Amazon. An is located in 410 Terry Ave N, Seattle 98109,WA.

Explanation:

7 0
3 years ago
Determine the output of the following code segment:
Nataly [62]

Answer:

The output to the given code as follows:

Output:

10

100

64

36

16

4

0

4

16

36

64

Explanation:

In the given java code, an integer variable "i" and an array number is defined, which size is 10, in the next step two for loop is declared, that can be described as follows:

  • In the first loop, array use loop variable "i" use, which minus the value of 5 and multiplies by 2, and it will calculate the square of that number.
  • In the next step, a for loop is declared, that prints these array number variable square.
7 0
3 years ago
Cell address A4 in a formula means it is a _________Mixed cell reference​
wel

Answer:

Relative cell reference.

Explanation:

Microsoft Excel is a software application or program designed and developed by Microsoft Inc., for analyzing and visualizing spreadsheet documents.

A spreadsheet can be defined as a file or document which comprises of cells in a tabulated format (rows and columns) typically used for formatting, arranging, analyzing, storing, calculating and sorting data on computer systems.

A relative cell reference can be defined as a cell whose reference is mainly relative to the location of the cell.

In Microsoft Excel, the cell reference is considered to be a relative reference by default.

Hence, the cell address A4 in a formula means it is a relative cell reference and when the formula is copied, the reference in the formula will change.

For example, if you refer to cell A4 from cell D4, it means you're pointing to the cell that is three (3) columns to the left of the same row i.e D minus A (D - 4).

6 0
2 years ago
R15. Suppose there are three routers between a source host and a destination host. Ignoring fragmentation, an IP datagram sent f
maria [59]

Answer:

The answers are: an IP datagram, and 3 forwading tables.

Explanation:

An IP datagram sent from a source host to a destination host will travel through 8 interfaces. 3 forwarding tables will be indexed to move the datagram from source to destination.

8 0
2 years ago
Other questions:
  • Sequentially prenumbered forms are an example of a(n): a. Processing control. b. Data transmission control. c. Input control. d.
    10·1 answer
  • Describe shortly about the following Linux directories and theirpurpose,1. lib2. etc3. Boot4. Root5. home
    6·1 answer
  • How to write a self-analysis essay
    5·1 answer
  • Which of the following reflects Moore's law? Multiple Choice The doubling of computer chip performance per dollar every two year
    11·1 answer
  • Bytes are typically represented with a lowercase b and bits with an uppercase B.<br> true or false
    7·1 answer
  • What is the name of the virus that appears to be a legitimate program but when opened
    9·1 answer
  • "The principle of ______________ states that programs tend to access data and instructions nearby recently used data and instruc
    12·1 answer
  • Power point presentation make use of pages known as
    9·2 answers
  • In python 3.17 LAB: Convert to dollars
    14·1 answer
  • An entity is said to be _____-dependent if it can exist in the database only when it is associated with another related entity o
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!