webDOMinator - Minion Scripting Language Reference

Search a Command:
<< Back to Events and Event Variables

event

Usage...
event:handle:script-file;condition
Creates an event. An event is something that waits for a condition to be met and then runs the script specified by script-file. The events engine checks the conditions for each declared event every second. Anything can be used for the condition including browser elements, program variables and shared variables.
This applies to webDOM version 3.0.0 and above.

User Comments on event

An important note on ending events

Written by: webDOMinator 1 year and 7 months ago

Many times users will only want an event to run once when the event's condition is met. There are two ways to make sure this happen: killing the event, and "ending" it by taking away it's condition. If you kill the event, it's no longer actually there. It's like deleting the event listener. If you simply "end" the event, what you're doing is removing the actual conditions which caused the event to fire.

The best way to create an event and make the resulting script only run once is to remove the condition that caused the event to fire. For instance, if I create an event by running this line of code...

Code

event:myevent:sys.scriptdir^textbox.qa:madman<in>dom.body.1.innerhtml

And the script for "textbox.qa" is...
Code

dom.body.1.innerhtml=<textarea rows=50 cols=80></textarea>

You can see that I'm using dom.body.1.innerhtml for both the condition of the event and also in the script that the event fires. This means that if I type the text "madman" into some place inside the webDOM browser, it will cause the "myevent" event to fire and it will run my script. In my script, it replaces the entire body of the page with a big textarea text box. This removes my condition and ends the event. If I type "madman" into the big text box at any point in time, it will thus fire the event again, almost looping.

Post a Comment About the "event" Command
Title:
Comment:
Post as Anonymous:
User Login
Username:
Email:
Password:
webDOMinator is copyright ©2008, 2009, 2010, 2011, 2012 Nathaniel D. Gibson. All Rights Reserved.
Contact | Tutorials | Forum
By using webDOMinator you are taking all liability in to your own hands. Nathaniel D. Gibson is not responsible for any damages, loss, or defamation (legal or otherwise) caused to you or your business from using this program. Nathaniel D. Gibson is not associated with, affiliated with, nor responsible for the content submitted and displayed by users of this site.