Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6326927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:11:03+00:00 2026-05-24T17:11:03+00:00

I am really lost here, and I have no idea what I am doing

  • 0

I am really lost here, and I have no idea what I am doing wrong.
I have exposed an api which gives a json output, and I want to fetch this data from another domain. Since jsonp is way to go, I am trying the code below.. Inspection on firebug shows that the response to the request is proper JSON, but the callback functions never seem to execute. Any help?

$(function(){
    console.log('aa');

    $.ajax({
        url: 'http://domain/api.php',
        data: {f:'get_total_playtime',userid:'1',starttime:'2011-01-01',endtime:'2011-12-12'},
        dataType: 'jsonp',
        success: function(data){
            console.log('suceess');
            alert(data.time);
        },
        failure: function(data){
            console.log('failure');
        }
    });


});

If this is not the right way to go about it, can anyone explain the right way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:11:04+00:00Added an answer on May 24, 2026 at 5:11 pm

    Inspection on firebug shows that the response to the request is proper JSON

    Then that is the problem. You have to return JSONP, not JSON.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a bit lost here as I have not really looked at model
I have a really tricky thing going up here. My project has around 100
Ok so I have two classes in which they are not really associated with
I really have little idea how ACL do work. I know it's pretty cool
I'm really lost here. I already checked many answers to how to add something
This is probably really easy, but I'm lost on how to make sure it
Really simple problem: I want to split a connection string into its keyword /
Really ripping my hair out on this one. I have a JAAS Authentication Provider
Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return
I'm really confused here. Let's say my user story looks like this. A user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.