Warning |
---|
title | Engine Compatibility |
---|
|
content_changed is not supported by the Node engine. |
content_changed(<selector>) with parameters = {"name": "value"}
The content_changed action allows for the checking of changes to the text contents on a page using a jquery selector. This action will set an event timer that executes ever ½ second and checks the prior value of the content with the current contents. If it changes a content_change event will be raised with the optional parameters passed back.
Code Block |
---|
language | javascript |
---|
theme | Confluence |
---|
language | javascript |
---|
|
content_changed("#foo") with parameters = {"name": "value"} |
The following ruleset shows content_changed being used
Code Block |
---|
language | javascript |
---|
theme | Confluence | language | javascript |
---|
|
ruleset a1299x167 {
meta {
name "Content Changed Example"
author "nathan cerny"
logging on
}
dispatch {
// domain "exampley.com"
}
rule watcher is active {
select when pageview ".*" setting ()
{
append('body', '<div id="res">Original Content</div>');
content_changed("#res") with parameters = {"search_results":true};
emit <<
setTimeout(function () {
$K('#res').html("New Content");
}, 1000);
>>;
}
}
rule true_listener is active {
select when web content_change search_results "true" setting ()
{
notify("Content Changed","true listener");
}
}
rule false_listener is active {
select when web content_change search_results "false" setting ()
{
notify("Content Changed","false listener");
}
}
} |
...