me').value || 'User';
        
        data.value = JSON.stringify({
          chatname: senderName,
          chatmessage: message,
          type: platformType
        });
      }
      
      // Try fetch method first
      fetch(url, {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json'
        },
        body: JSON.stringify(data)
      })
      .then(response => {
        if (!response.ok) {
          throw new Error('Network response was not ok')