Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

339
Visualizações
How to fix issue on tampermonkey script

I am using a tampermonkey script but I have this error. I don't know how to fix this issue.

the error displayed the source

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]
            }
        })
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

The script seems to be missing a + symbols ...

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
                ]
            }
        })
about 4 years ago · Juan Pablo Isaza Relatório

0

Try to use ` ... ` ;
You can search about template string in 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
                    ]
                }
            })

Also, you can try like below;

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@" > ',
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda