Printing the Page

1 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€85.85
List Price:  €120.20
You save:  €34.34
£75.29
List Price:  £105.42
You save:  £30.12
CA$139.53
List Price:  CA$195.35
You save:  CA$55.82
A$151.91
List Price:  A$212.69
You save:  A$60.77
S$129.50
List Price:  S$181.31
You save:  S$51.80
HK$778.39
List Price:  HK$1,089.78
You save:  HK$311.38
CHF 80.17
List Price:  CHF 112.24
You save:  CHF 32.07
NOK kr1,009.31
List Price:  NOK kr1,413.07
You save:  NOK kr403.76
DKK kr641.25
List Price:  DKK kr897.78
You save:  DKK kr256.52
NZ$174.13
List Price:  NZ$243.80
You save:  NZ$69.66
د.إ367.21
List Price:  د.إ514.11
You save:  د.إ146.90
৳12,191.62
List Price:  ৳17,068.76
You save:  ৳4,877.13
₹9,019.51
List Price:  ₹12,627.67
You save:  ₹3,608.16
RM412.50
List Price:  RM577.52
You save:  RM165.02
₦144,457.55
List Price:  ₦202,246.35
You save:  ₦57,788.80
₨28,185.33
List Price:  ₨39,460.59
You save:  ₨11,275.26
฿3,192.33
List Price:  ฿4,469.39
You save:  ฿1,277.06
₺4,244.10
List Price:  ₺5,941.91
You save:  ₺1,697.81
B$533.64
List Price:  B$747.12
You save:  B$213.48
R1,710
List Price:  R2,394.08
You save:  R684.07
Лв167.98
List Price:  Лв235.18
You save:  Лв67.20
₩146,538.35
List Price:  ₩205,159.56
You save:  ₩58,621.20
₪324.13
List Price:  ₪453.80
You save:  ₪129.66
₱5,891.26
List Price:  ₱8,248
You save:  ₱2,356.74
¥15,560.70
List Price:  ¥21,785.61
You save:  ¥6,224.90
MX$1,826.45
List Price:  MX$2,557.10
You save:  MX$730.65
QR364.65
List Price:  QR510.53
You save:  QR145.87
P1,333.36
List Price:  P1,866.76
You save:  P533.39
KSh12,943.70
List Price:  KSh18,121.70
You save:  KSh5,178
E£4,751.35
List Price:  E£6,652.08
You save:  E£1,900.73
ብር15,409.57
List Price:  ብር21,574.01
You save:  ብር6,164.44
Kz91,216.93
List Price:  Kz127,707.36
You save:  Kz36,490.42
CLP$92,386.76
List Price:  CLP$129,345.16
You save:  CLP$36,958.40
CN¥706.37
List Price:  CN¥988.95
You save:  CN¥282.58
RD$6,298.13
List Price:  RD$8,817.64
You save:  RD$2,519.50
DA13,013.32
List Price:  DA18,219.18
You save:  DA5,205.85
FJ$226.58
List Price:  FJ$317.23
You save:  FJ$90.64
Q764.28
List Price:  Q1,070.03
You save:  Q305.74
GY$20,873.29
List Price:  GY$29,223.44
You save:  GY$8,350.15
ISK kr12,774.72
List Price:  ISK kr17,885.12
You save:  ISK kr5,110.40
DH923.18
List Price:  DH1,292.49
You save:  DH369.31
L1,699.07
List Price:  L2,378.77
You save:  L679.69
ден5,295.87
List Price:  ден7,414.43
You save:  ден2,118.56
MOP$800.14
List Price:  MOP$1,120.23
You save:  MOP$320.08
N$1,708.62
List Price:  N$2,392.14
You save:  N$683.51
C$3,671.47
List Price:  C$5,140.21
You save:  C$1,468.73
रु14,362.10
List Price:  रु20,107.51
You save:  रु5,745.41
S/336.50
List Price:  S/471.11
You save:  S/134.61
K422.99
List Price:  K592.21
You save:  K169.21
SAR375.24
List Price:  SAR525.35
You save:  SAR150.11
ZK2,292.25
List Price:  ZK3,209.25
You save:  ZK916.99
L436.93
List Price:  L611.72
You save:  L174.79
Kč2,071.96
List Price:  Kč2,900.84
You save:  Kč828.87
Ft32,683.18
List Price:  Ft45,757.76
You save:  Ft13,074.58
SEK kr939.74
List Price:  SEK kr1,315.68
You save:  SEK kr375.93
ARS$145,633.56
List Price:  ARS$203,892.81
You save:  ARS$58,259.25
Bs689.44
List Price:  Bs965.25
You save:  Bs275.80
COP$379,711.65
List Price:  COP$531,611.50
You save:  COP$151,899.85
₡49,130.59
List Price:  ₡68,784.79
You save:  ₡19,654.20
L2,628.55
List Price:  L3,680.08
You save:  L1,051.52
₲691,938.08
List Price:  ₲968,741
You save:  ₲276,802.91
$U3,934.14
List Price:  $U5,507.95
You save:  $U1,573.81
zł363.22
List Price:  zł508.52
You save:  zł145.30
Already have an account? Log In

Transcript

Hello, in this JavaScript video, I am going to show you how to trigger the print method. So if you go to like Chrome or Firefox to do click Print, you know, this little thing gets triggered and obviously there's nothing in there to print. So if I were to just simply print other h1 Hello, well and go back go to here, print. Oh, I forgot to reload it. My bad. Oh, I wonder why did that not work?

There we go. Okay, so if you want to actually trigger it programmatically, so like a button on your website triggers the print method. You can do that pretty easily. So I'll create a div and this will have an on click event. Oh, Click equals, print and print the page. Now what we do in here, we're gonna create a function called print up.

And then in here to print, it's actually really simple. You just do window, print, not Pre Owned, print, reload, click Print the page, as it says trigger there, and it's printing the entire page. And honestly, that's it. That's all there is to triggering the print event in a web browser via your website. If you have any questions, feel free to pop me a message. As usual, there will be a GitHub link to all of the source code and I look forward to seeing you in the next video.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.