Ir para conteúdo
Fórum Script Brasil
  • 0

Problema com validação W3C


R_MontSerrat

Pergunta

Boa tarde, pessoal.

Tenho uma função javascript que chama um iframe no InnerHtml de uma div, funciona normalmente mas quando passo no validador W3C, ele não aceita

já fiz de tudo e não consigo solucionar

aqui está o código

function clica_informatica(){
        document.getElementById("principal").className="informatica";
        document.getElementById("principal").innerHTML="<iframe src='informatica' height='710' frameborder='0' width='1024' scrolling='no'></iframe>" 
}

E aqui é o erro:

Line 43, Column 132: document type does not allow element "iframe" here

…etronicos' height='710' frameborder='0' width='1024' scrolling='no'></iframe>"

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

Alguém tem como me ajudar?

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

Pelo que eu vi é erro de sintax, tenta substituir por este:

function clica_informatica(){
        document.getElementById("principal").className="informatica";
        document.getElementById("principal").innerHTML="<iframe src='/informatica' height='710' frameborder='0' width='1024' scrolling='no'></iframe>";
}

Abraços. \o

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...