Article ID: 185128
Article Last Modified on 7/2/2004
185140 PRB: Trouble Inserting Non-Displayable HTML into Web Page
Option Explicit
Private Sub Command1_Click()
Dim str As String
' Insert some hidden HTML and the script
str = "<span style='display:none'>h</span><script defer>" & _
"function document.onclick() {alert(1);}</script>"
WebBrowser1.Document.body.insertAdjacentHTML "BeforeEnd", str
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "http://SomeServer/SomeWebPage.htm"
End Sub
Debug.Print WebBrowser1.Document.body.outerHTML
Keywords: kbhowto KB185128