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

206
Views
Copie la función del portapapeles que funciona localmente pero no funciona en el servidor

Estoy usando el siguiente script: funciona localmente en Visual Studio. pero en el servidor tira

"No se puede leer la propiedad 'escribir texto' de indefinido"

 function GetCopyText(thislink) { var Content = thislink.parentNode.parentNode.parentNode.parentElement.parentElement.parentElement.parentElement.children[2].children[0].children[0].innerText; navigator.clipboard.writeText(Content).then(function () { // alert('Async: Copying to clipboard was successful!'); }, function (err) { console.error('Async: Could not copy text: ', err); }); }
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Cree el protocolo https y el navegador debería ejecutarlo.

over 4 years ago · Santiago Trujillo Report

0

Tal vez sea demasiado tarde (y el código de un par de sitios se ve así). pero el tipo no hace eso:

 var Content = thislink. parentNode.parentNode.parentNode. parentElement.parentElement.parentElement.parentElement. children[2].children[0].children[0]. innerText;
over 4 years ago · Santiago Trujillo Report

0

La función de portapapeles está disponible solo en contextos seguros (HTTPS) , en algunos o en todos los navegadores compatibles.

https://developer.mozilla.org/en-US/docs/Web/API/Clipboard

gracias wade

Sugerencias: es mejor verificar el valor de navigator.clipboard y continuar solo si existe. Esto proporciona una buena experiencia de usuario y en organizaciones grandes, ya que muchos desarrolladores ejecutarán la interfaz de usuario en modo local para realizar pruebas. Les ahorra tiempo de depuración y luego descubren que navigator.clipboard no está disponible en modo local sin https.

over 4 years ago · Santiago Trujillo 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!