[ JS 에러 ] Uncaught TypeError: Failed to execute 'insertAdjacentElement' on 'Element': parameter 2 is not of type 'Element'.
💻기술/에러와의 전쟁

[ JS 에러 ] Uncaught TypeError: Failed to execute 'insertAdjacentElement' on 'Element': parameter 2 is not of type 'Element'.

반응형

I. 에러

 

생각보다 심심찮게 볼 수 있는 귀여운 에러입니다.

여느 때와 마찬가지로 스택오버플에 등재(?)되어 있는데

링크는 아래 첨부해두겠습니다.

 

에러

 

II. 해결방법

 

div.insertAdjacentElement

div.insertAdjacentHTML

로 변경해주면 됩니다.

 

 

https://stackoverflow.com/questions/42628635/element-insertadjacenthtml-api-throws-error-in-chrome-55-0-2883-87

 

Element.insertAdjacentHTML() API throws error in chrome 55.0.2883.87

I found the explaination about the API here, which tells me the second parameter is a string. It's perform normal in firefox. However, in chrome, it shows the errors below: I just curious about w...

stackoverflow.com

 

반응형