Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
Elimine todo de la página y reemplácelo con el juego unity onclick

El título se explica por sí mismo. Estoy tratando de ocultar un href oculto que, cuando se hace clic, borra todo en la página, dejándolo en blanco por un segundo antes de insertar el juego de unidad como la página completa.

Esto es lo que tengo hasta ahora.

 <!DOCTYPE html> <html> <script> function wipeHTML() { document.documentElement.innerHTML = nothing; //NEED HELP HERE then wait 1 second document.documentElement.innerHTML = unity game loads; //NEED HELP HERE } </script> <!-- UNITY STUFF --> <head> <link rel="stylesheet" href="TemplateData/style.css"> <script src="TemplateData/UnityProgress.js"></script> <script src="TemplateData/unityloader41.js"></script> <script> var gameInstance = UnityLoader.instantiate("gameContainer", "Build/slope.json", { onProgress: UnityProgress, Module: { onRuntimeInitialized: function() { UnityProgress(gameInstance, "complete") } } }); </script> </head> <body style="margin: 0; overflow: hidden;"> <div class="webgl-content"> <div id="gameContainer" style="width: 100%; height: 100%; margin: 0;"></div> </div> </body> <!-- UNITY STUFF END --> <h1> <a href="javascript:wipeHTML">wipe everything</a> </h1> <div> <h1> hello </h1> <h3> erase me </h3> </div>

¡Dime qué estoy haciendo mal! 🤷‍♂️

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Para borrar el cuerpo de la página:

 document.body = document.createElement("body");

Para mostrar el juego, agregue un tiempo de espera, reemplace console.log con el código para mostrar el juego.

 setTimeout(() => console.log("load unity here"), 5e3)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!