ltm rule event HTML TAG MATCHED
iRule(1) BIG-IP TMSH Manual iRule(1)
HTML_TAG_MATCHED
Is raised when an HTML tag is encountered.
DESCRIPTION
The HTML_TAG_MATCHED event is raised when an HTML tag is encountered in
a document and there is a rule attached to the HTML profile that says
to raise an event on matching tag with the specific tag name and
optionally the specific attribute name and value.
Examples
when HTTP_REQUEST {
set uri [HTTP::uri]
HTTP::header replace "Host" "finance.yahoo.com"
}
when HTTP_RESPONSE {
if { $uri equals "/" } {
HTML::enable
} else {
HTML::disable
}
}
when HTML_TAG_MATCHED {
log local0. "element = [HTML::tag name]"
log local0. "attribute id = [HTML::tag attribute id]"
switch [HTML::tag name] {
"form" {
if { [HTML::tag attribute "id"] equals "quote" } {
set inject_js 1
}
}
"/form" {
if { [info exists inject_js] && $inject_js == 1 } {
unset inject_js
HTML::tag append ""
HTML::tag append "function submitForm() {"
HTML::tag append " document.quote.s.value='FFIV';"
HTML::tag append " document.quote.submit();"
HTML::tag append "}"
HTML::tag append "setTimeout('submitForm()', 5000);"
HTML::tag append ""
}
}
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-11.0.0 --First introduced the event.
BIG-IP 2017-01-31 iRule(1)