Created
November 10, 2010 12:40
-
-
Save edoloughlin/670796 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
| class MyAPI | |
| objectToXml: (obj) -> | |
| '<?xml version="1.0"?>' + (new XMLSerializer()).serializeToString objectToDOM(obj) | |
| login: (email, password, success_callback, error_callback) -> | |
| console.log "API login. email: [#{email}], password: [#{password}]" | |
| xmlData = objectToXml { login: { email: email, password: password }} | |
| # do something with xmlData | |
| window.MyAPI = new MyAPI |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MyAPI.login is called from another file:
I get the following error:
(This is line 8 above)
I've also tried using this.objectToXml and MyAPI.objectToXml with the same results. What gives?