Created
March 9, 2012 17:23
-
-
Save iggymacd/2007633 to your computer and use it in GitHub Desktop.
Dart sample click simulation
This file contains 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
#import("dart:html"); | |
void main() { | |
document.query('#button').on.click.add( (e) | |
{ | |
document.query('#result').innerHTML="clicked!"; | |
}); | |
MouseEvent e = new MouseEvent( 'click', window, 0,0,0,0,0,0, | |
canBubble:true, cancelable:true, | |
relatedTarget:document.query("#button")); | |
document.query("#button").on.click.dispatch(e); | |
} |
This file contains 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
<html> | |
<head> | |
<title>playground</title> | |
</head> | |
<body> | |
<h1>playground</h1> | |
<div id="button">Click me!</div> | |
<div id="result"></div> | |
<script type="application/dart" src="playground.dart"></script> | |
<script src= | |
"http://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"> | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment