Hello community, I need your help, “When I try to share the current page using the share button, it doesn’t go through. And it always shows this URL. (Communication Interface)
How do I fix this?”
Code :
Communication Interface * { margin: 8px; /* Set margin to 8px for all elements */ box-sizing: border-box; /* Include padding and border in the element's total width and height */ } body,
html {
height: 100%;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center; /* Center vertically */
gap: 3px; /* Set gap to 3px */
height: 100%;
}
.section {
border: 1px solid rgb(231,233,235, 0.1); /* Add 05% border color */
padding: 0px;
width: 260px; /* Set column width */
height: 140px; /* Set column height */
text-align: center; /* Added to center headings */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center; /* Center align the content */
border-radius: 7px; /* Add rounded corners */
background-color: #f0f0f0; /* Add background color to sections */
}
.button {
margin: 7px; /* Set equal margin for all sides */
padding: 6px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center; /* Center align the content */
width: 130px; /* Set button width */
height: 40px; /* Set button height */
background-color: #04AA6D; /* Set button background color */
color: white; /* Set button text color */
border: 0px; /* Remove button border */
border-radius: 4px; /* Add rounded corners to buttons */
}
input[type="text"],
input[type="email"] {
width: 250px; /* Set input width */
height: 40px; /* Set input height */
margin-bottom: 3px; /* Add some space below the input */
}
</style>
Send WhatsApp
Send WhatsAppSend Email
Send EmailSend SMS
Send SMS function sendWhatsApp() {
const number = document.getElementById('whatsappNumber').value;
window.open(`https://wa.me/${number}?text=${encodeURIComponent(message)}`, '_blank');
}
function sendEmail() {
const email = document.getElementById('email').value;
window.location.href = `mailto:${email}?body=${encodeURIComponent(message)}`;
}
function sendSMS() {
const number = document.getElementById('smsNumber').value;
window.open(`sms:+91${number}?body=${encodeURIComponent(message)}`);
}
// Attach functions to buttons
document.querySelector('button[onclick="sendWhatsApp()"]').onclick = sendWhatsApp;
document.querySelector('button[onclick="sendEmail()"]').onclick = sendEmail;
document.querySelector('button[onclick="sendSMS()"]').onclick = sendSMS;
};
</script>