_IEDocInsertHTML : Inserts HTML Text in or around an element.
在一个元素内或者周围插入HTML代码
#include <IE.au3>
_IEDocInsertHTML ( ByRef $o_object, $s_string [, $s_where = "beforeend"] )
例子:
; *******************************************************
; Example 1 - Insert HTML at the top and bottom of a document
; *******************************************************
;
#include <IE.au3>
$oIE = _IECreate("http://www.baidu.com")
$oBody = _IETagNameGetCollection($oIE, "body", 0)
_IEDocInsertHTML($oBody, "<h2>This HTML is inserted After Begin</h2>", "afterbegin")
_IEDocInsertHTML($oBody, "<h2>This HTML is inserted Before End</h2>", "beforeend")
例子:
; *******************************************************
; Example 2 - Open a browser with the basic example page, insert HTML
; in and around the DIV tag named "IEAu3Data" and display Body HTML
; *******************************************************
;
$oIE = _IE_Example ("basic")
$oDiv = _IEGetObjByName($oIE, "IEAu3Data")
_IEDocInsertHTML($oDiv, "<b>(HTML beforebegin)</b>", "beforebegin")
_IEDocInsertHTML($oDiv, "<i>(HTML afterbegin)</i>", "afterbegin")
_IEDocInsertHTML($oDiv, "<b>(HTML beforeend)</b>", "beforeend")
_IEDocInsertHTML($oDiv, "<i>(HTML afterend)</i>", "afterend")
ConsoleWrite(_IEBodyReadHTML($oIE) & @CRLF)