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

215
Views
Verifique si el navegador del usuario no es compatible con javascript sin <noscript>

Quería hacer que mi sitio web mostrara algo si no usaban JavaScript. Sé que podría usar la etiqueta <noscript> , pero si tengo CSS en mi página, quiero que borre mi CSS para que pueda leer el texto.

 function test() { alert("you are using javascript!"); }
 body { background-color:#200; }
 <input type="button" value="Click Me with JavaScript" onClick="test()"> <noscript>You liar! You don't have JavaScript!</noscript>

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

0

Lo más fácil es crear un pequeño archivo css para tener el CSS noscript , como se muestra a continuación. Tenga en cuenta que puede diseñar el texto como desee. Este es solo un ejemplo. Incluso puede agregar su css que desea ejecutar solo en un entorno sin script en esta hoja

 body:before{ content: 'Please turn on Javascript'; color: white; font-family: sans-serif; font-size: 2em; font-weight: bold; text-align: center; width: 100%; padding: 1em 0; background: rgba(0,0,0,0.9); }

Luego agregue el siguiente HTML

 <noscript> <link rel="stylesheet" type="text/css" href="noscript.css"> </noscript>
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!