
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.

// 기능2: 공유하기
document.getElementById('shareButton').addEventListener('click', async () => {
try {
// Check if the Web Share API is available
if (!navigator.share) {
alert('Web Share API is not available on your browser.');
return;
}
// Your share data
const shareData = {
title: 'Web Share Example',
text: 'Check out this web share example!',
url: window.location.href
};
Share failed: Failed to execute 'share' on 'Navigator': An earlier share has not yet completed.
// Invoke the share dialog
await navigator.share(shareData);
console.log('Data was shared successfully');
} catch (err) {
console.error('Share failed:', err.message);
}
});
Share failed: Failed to execute 'share' on 'Navigator': An earlier share has not yet completed.
