-
-
Save apipkin/700532 to your computer and use it in GitHub Desktop.
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
| // Ajax event request handler | |
| SendAjaxRequest = function(Event) | |
| { | |
| YUI().use( | |
| "io-base", "json", | |
| function(Y) | |
| { | |
| var myScriptEvent = escape(Y.JSON.stringify(Event)); | |
| Y.io("http://localhost/ScriptHandler.php?ScriptEvent=" + myScriptEvent, { | |
| method: "POST", | |
| on : { | |
| complete : Y.bind(HandleAjaxResponse, Y) | |
| } | |
| }); | |
| } | |
| ); | |
| } | |
| YUI().use('myWidget', function(Y){ | |
| var myWidget = new MyWidget({render:true}); | |
| myWidget.on('custom:event', Y.bind(SendAjaxRequest, this)); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment