Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajax example #11

Open
bartosz-k opened this issue May 6, 2013 · 2 comments
Open

Ajax example #11

bartosz-k opened this issue May 6, 2013 · 2 comments

Comments

@bartosz-k
Copy link

Hey!

Nice project. I wonder why this code does not work:

$.ajax({
  url:'http://int3.github.io/metajs/',
  success: function(data){
    console.log(data);
  }});

Any clues?
Thanks!
Bartek

@omphalos
Copy link
Collaborator

This does appear to be an issue. I think this is because the callback gets turned into an InterpretedFunction object by metajs.

I copy-pasted the code you have here into the metajs editor at http://int3.github.com/metajs, and added the following line:

window.f = function(data){ console.log(data); }

Then I typed f into the console to show the type. Then I tried

f('test')

which fails with a TypeError since f is an object (InterpretedFunction) not an actual function.

So my guess as to the resolution of this issue is for metajs to resolve functions to actual functions instead of InterpretedFunction, and instead attach the properties that InterpretedFunction uses under the function object. That way, non-metajs JavaScript should interop properly with metajs JavaScript.

@kumavis
Copy link

kumavis commented Aug 13, 2013

+2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants