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 9065289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:27:48+00:00 2026-06-16T16:27:48+00:00

Update IV / Current status: I’ve now confirmed trough another question that the character

  • 0

Update IV / Current status: I’ve now confirmed trough another question that the character encoding of the file is fine and not the cause of the problem. I’ve also tested against another server and the error still persists. It does however work towards localhost.
So to summarize: JSONP call works towards localhost, but when running against external domains the response from the server is empty (no header / no http response code). When copying the requested URL and inserting it directly in a browser, the output is correct with correct formating (utf-8 / json).

Fiddle: http://jsfiddle.net/5SJvp/1/

Update III: I’m now able to get it working succesfully on localhost. However, using the exact same code (both client and server) towards my production domain it still fails. The response from the server is “empty” meaning to say it returns no http status code.

Update II: After some more debugging I noticed that the response does not include an http status code. This probably is the cause of my problem? I assume this means there is something wrong server side, but I cannot for the life of me see where.

Update I: Snip from jQuery where to request seems to halt.

// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null ); 

Params (from Firebug)

_   1356655864905
callback    jQuery18308375673194150332_1356655863817
p   0522
pl  12
s   false
secret  ##############################
u   request12341299

Request (from Firebug)

Accept  text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
Accept-Encoding gzip, deflate
Accept-Language nb-no,nb;q=0.9,no-no;q=0.8,no;q=0.6,nn-no;q=0.5,nn;q=0.4,en-us;q=0.3,en;q=0.1
Connection  keep-alive
Host    localhost:8888
Referer http://localhost:8888/popup.html
User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20100101 Firefox/17.0
X-Requested-With    XMLHttpRequest

Original question:

I’m struggling with what seems to be a common problem, but I’ve yet to find a solution. I’m trying to execute a very simple jsonp call using jQuery. The problem is that either a) nothing is happening or b), the response from the server is empty.

I’ve tried several different approaches, using both the $.ajax method and the $.getJSON method. Both produce the same faulty result. Using the code below nothing happens: Using the Chrome debugger I can see that it simply stops its execution halffway trough the method. However using Wireshark I can see that the client performs the three way handshake and thusly prepars to send data, it just fails to do that.

If I remove the callback=? it does execute, however the response is malformed (or at least, I think so since I can only see a response marked with a red line in Firebug).

$.ajax({
     url: "http://mydomain.com/asd.php", //"http://localhost:8888/index.php",
     dataType: 'jsonp',
     type: 'GET',
     data: {p:p, u:u, s:symbols, pl:pl, secret:secret},
     contentType: "application/json; charset=utf-8",
     async: false,
     success: function(data){
        console.log("What " + data.test); 
     }, 
     error: function(data){
         console.log("failed for some reason");
     }
 }); 

Server code ($callback = $_GET[“callback”]

<?php header('content-type: application/json; charset=utf-8');
.
.
.
$data = array
(
    "message" => $message,
    "status" => $statuscode,
    "length" => strlen($message)        
);

echo $callback . '('.json_encode($data) .')';
exit;       
?>

Here is the server response with manually typed input.

funcName({"message":"!0b7(cb6Gv40","status":"OK","length":12})
  • 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-06-16T16:27:49+00:00Added an answer on June 16, 2026 at 4:27 pm

    This will obviously NOT work if you did not set up your SSL certificates properly.

    This works properly when I transform the https to http: http://jsfiddle.net/eysEe/

    var u = "test";
    var p = 1234;
    var symbols = false;
    var pl = 16;
    var secret = "c68f39913f901f3ddf44c707357a7d70";
    
    $.ajax({
        url: "http://serve.pin2pass.com?index.php",
        dataType: 'jsonp',
        type: 'GET',
        data: {
            p: p,
            u: u,
            s: symbols,
            pl: pl,
            secret: secret
        },
        contentType: "application/json; charset=utf-8",
        async: false,
        success: function(data) {
            $('#test').text(data.message);
        },
        error: function(data) {
            $('#test').text("SDf");
        }
    });
    

    You can tell if you have bad SSL installation when “https://serve.pin2pass.com?index.php” leads to a risky page. Maybe you never intended to put it in https mode ?

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

Sidebar

Related Questions

I am building a desktop application that needs to update current user's status frequently.
I would like to update my current SB2 theme Sunburst so that the current
I'm trying to make a very simple updater app that reads current version.txt file
I have a background thread that is sending data about the application's current status
We are designing an update to a current system (C++\CLI and C#). The system
The code i current have is this. function update (){ latest_id = $('#image:first').data('position'); /*
Is it possible to INSERT...ON DUPLICATE KEY UPDATE into a table on the current
I have the following script that successfully retrieves the current track and updates my
This was working perfectly and now I'm not sure what happened. Here are the
Current Status: I have a movie I recorded on a microscopy and a .txt

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.