MediaWiki:Timeless.js

De RubinOT Wiki
Revisão de 17h14min de 17 de maio de 2024 por Lukio (discussão | contribs)

Nota: Após publicar, você pode ter que limpar o "cache" do seu navegador para ver as alterações.

  • Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
  • Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
  • Internet Explorer/Edge: PressioneCtrl enquanto clica Recarregar, ou Pressione Ctrl-F5
  • Opera: Pressione Ctrl-F5.
// Função para fazer fetch dos dados
function fetchData() {
    const url = 'https://rubinot.com.br/webservices/worlds.php';

    fetch(url)
        .then(response => {
            if (!response.ok) {
                throw new Error('Network response was not ok ' + response.statusText);
            }
            return response.json();
        })
        .then(data => {
            console.log(data); // Exibe o conteúdo no console
        })
        .catch(error => {
            console.error('There has been a problem with your fetch operation:', error);
        });
}

// Chamar a função quando o documento estiver pronto
document.addEventListener('DOMContentLoaded', fetchData);