1
resposta

Imagem não carrega

Ao submeter o script, a imagem não é carregada e ocorre o erro descrito a seguir.

<script>
document.body.innerHTML="";
var imagem=new Image();
imagem.src="https://cdn.pixabay.com/photo/2015/06/18/01/46/hack-813290_960_720.jpg";
document.body.appendChild(imagem);
</script>
unreachable code after return statement jquery.min.js:19:13091
SyntaxError: unterminated comment index.php:916:28
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. index.php
TypeError: $mainmenu.parent(...).get(...) is undefined

Onde está o erro?

Obrigada! : )

1 resposta

Acrescentando a linha de código descrita a seguir, consegui que a imagem fosse mostrada no browser como usuário. Na Kali Linux, o erro persiste.

header("Content-type: text/html; charset=ISO-8859-5");
<script>
document.body.innerHTML="";
var imagem=new Image();
imagem.src="https://cdn.pixabay.com/photo/2015/06/18/01/46/hack-813290_960_720.jpg";
document.body.appendChild(imagem);
</script>

: (

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software