Created
August 23, 2010 19:49
-
-
Save MikeGrace/546178 to your computer and use it in GitHub Desktop.
Kynetx app that raises event in JavaScript and also shows how to pass data back to the Kynetx server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruleset a60x301 { | |
meta { | |
name "js raise event pass data" | |
description << | |
js raise event pass data | |
>> | |
author "Mike Grace" | |
logging on | |
} | |
dispatch { | |
domain "example.com" | |
} | |
rule first_rule is active { | |
select when pageview ".*" | |
{ | |
notify("App Ran","The app has run and now to raise an event via JavaScript") with sticky = true; | |
emit << | |
var app = KOBJ.get_application("a60x301"); | |
app.raise_event("shazam"); | |
app.raise_event("mustafa", {"datum":"here is the datum 383409"}); | |
>>; | |
} | |
} | |
rule first_rule is active { | |
select when web shazam | |
{ | |
notify("JS raised event","simple with no data") with sticky = true; | |
} | |
} | |
rule data_passed_js_raised_event is active { | |
select when web mustafa | |
pre { | |
testy = page:env("datum"); | |
} | |
{ | |
notify("JS raised event with data",testy) with sticky = true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment