Skip to content

Commit

Permalink
gave an object as parameter for navigator.share because it took objec…
Browse files Browse the repository at this point in the history
…t as parameter
  • Loading branch information
vishal30982 committed Dec 7, 2023
1 parent b001eed commit a42163b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ let share_btn = document.querySelector('#share-area button')
let share_link = location.href;
share_btn.addEventListener('click', async () => {
try {
await navigator.share(share_link)
await navigator.share({
url: share_link
})
} catch (error) {
alert('Something Went Wrong In Sharing!')
}
Expand Down

0 comments on commit a42163b

Please sign in to comment.