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

Error when calling $$.json #31

Closed
ro-ka opened this issue Oct 1, 2012 · 3 comments
Closed

Error when calling $$.json #31

ro-ka opened this issue Oct 1, 2012 · 3 comments

Comments

@ro-ka
Copy link

ro-ka commented Oct 1, 2012

I tried to retrieve a simple json document with the current quo.js from the website. But I keep on getting this error in line 38 (minified version):

Uncaught TypeError: Object #<Object> has no method 'call' 

The call I do is the following:

$$.json(location.href + 'sample.json', function(response) {
  console.log(response);
});

Retrieving the same document with this Ajax call works fine:

$$.ajax({
  url: location.href + 'sample.json',
  dataType: 'json',
  async: true,
  success: function(response) { console.log(response); },
  error: function(xhr, type) { console.log(xhr, type); }
});
@soyjavi
Copy link
Owner

soyjavi commented Oct 19, 2012

The correct syntax is:

$$.json url, parameters, callback

$$.json(location.href + 'sample.json', {}, function(response) {
console.log(response);
});

@soyjavi soyjavi closed this as completed Oct 19, 2012
@ro-ka
Copy link
Author

ro-ka commented Oct 20, 2012

Thanks! But we already switched to Zepto as I couldn't find a way to hand over parameters on Events. But the Framework looks promising! Will keep an eye on it.

@VittorioMobimentum
Copy link

Sorry for postin on this old thread but it's the only Google Results I've found and I have the same issue.
Using:
$$.json("local/data.json", {}, successCallback );
I get the same error:

Uncaught TypeError: Object # has no method 'call'
at quo.debug.js:212

Apparently it lacks of a default error callback function (I was using an invalid JSON :D).

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