(Classic) before()

Engine Compatibility

before is not supported by the Node engine.

before(<selector>, <html>)

Place the <html> before (as a sibling of) the element selected by <selector>. The selector used can be any valid JQuery selector.

before("#foo", "<p>This is the text</p>")

The following ruleset shows before() being used

ruleset a1299x165 {
	meta {
		name "Before Example"
		author "nathan cerny"
		logging off
	}
	dispatch {
		// domain "exampley.com"
	}
	rule before_example_rule {
      select using ".*"
      before("#before", "<span style=\"color:red;\"> You fired the before rule!</span>");
    }
}

The following demonstrates the preceding rule:

Copyright Picolabs | Licensed under Creative Commons.