• Empleos
  • Sobre nosotros
  • Empleos
    • Inicio
    • Empleos
    • Cursos y retos
  • Empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

206
Vistas
Cómo solucionar el problema en el script tampermonkey

Estoy usando un script tampermonkey pero tengo este error. No sé cómo solucionar este problema.

el error mostrado la fuente

 document.onkeypress = async function(e) { e = e || window.event; var charCode = (typeof e.which == "number") ? e.which : e.keyCode; if (String.fromCharCode(charCode) === '=') { const { value: formValues } = await Swal.fire({ title: 'Enter your credentials ', html: '<input id="swal-input1" class="swal2-input" placeholder="email" type = "text" value = "kor@gmail.com" > ' + '<input id="swal-input2" class="swal2-input" placeholder="password" type = "password" value = "A23@" > ', focusConfirm: false, preConfirm: () => { return [ document.getElementById('swal-input1').value, document.getElementById('swal-input2').value ][![enter image description here][1]][1] } })
over 3 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Parece que al script le faltan los símbolos + ...

 document.onkeypress = async function(e) { e = e || window.event; var charCode = (typeof e.which == "number") ? e.which : e.keyCode; if (String.fromCharCode(charCode) === '=') { const { value: formValues } = await Swal.fire({ title: 'Enter your credentials ', html: '<input id="swal-input1" class="swal2-input"' + 'placeholder="email"' +'type = "text"' +'value = "kor@gmail.com" > ' + '<input id="swal-input2" class="swal2-input" placeholder="password"'+ 'type = "password"'+ 'value = "A23@" > ', focusConfirm: false, preConfirm: () => { return [ document.getElementById('swal-input1').value, document.getElementById('swal-input2').value ] } })
over 3 years ago · Juan Pablo Isaza Denunciar

0

Intenta usar `...`;
Puede buscar sobre la cadena de plantilla en javascript.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

 document.onkeypress = async function(e) { e = e || window.event; var charCode = (typeof e.which == "number") ? e.which : e.keyCode; if (String.fromCharCode(charCode) === '=') { const { value: formValues } = await Swal.fire({ title: 'Enter your credentials ', html: `<input id="swal-input1" class="swal2-input" placeholder="email" type = "text" value = "kor@gmail.com" > <input id="swal-input2" class="swal2-input" placeholder="password" type = "password" value = "A23@" > `, focusConfirm: false, preConfirm: () => { return [ document.getElementById('swal-input1').value, document.getElementById('swal-input2').value ] } })

Además, puedes probar como a continuación;

 html: '<input id="swal-input1" class="swal2-input" placeholder="email" type="text" value="kor@gmail.com"> <input id="swal-input2" class="swal2-input" placeholder="password" type="password" value="A23@" > ',
over 3 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda