Ajax request succeeds but result is empty
I am building a Google Chrome browser extension that uses $.ajax
requests to send data from webpages to my server (currently hosted using localhost). The content_script.js
file that is being executed in the context of the webpages (more on content scripts) that the extension has access to runs this code:
//note: encode64String is assigned earlier in the script...
$.ajax(
type: "POST",
url: "http://localhost:8888/quartzsite/uploadendpoint.php",
type: "jsonp",
data: img: encode64String,
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
success: function(data)
console.log("The ajax request succeeded!");
console.log("The result is: ");
console.log(data);
,
error: function()
console.log("The request failed");
);
The problem is that the Ajax
request is succeeding but the data
argument that it returns is empty...
The console looks like this after the code is run:
Currently the contents of the uploadedendpoint.php
file are:
<?php
header("Access-Control-Allow-Origin: *");
echo 'This comes from php file'; die();
?>
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
This means there should be at least something being returned in the data
variable.
I have further confirmed that the request is succeeding because when I send the request to a broken url (i.e. uploaddddddendpoint.php) the code inside the $.ajax
's error
parameter is executed.
I have read similar questions like jQuery $.ajax response empty, but only in Chrome but to no avail...
UPDATE:
I have removed the invalid second type: "jsonp"
parameter entirely and have added dataType: "text/html"
. I am now getting a failed ajax
request each time the code is run.
UPDATE: Strangely changing dataType : "text/html"
to dataType : "html"
causes the ajax
request to succeed but again with a blank data
variable.
UPDATE: When using the dev toolkit to monitor the Network XHR these are the sent/response messages:
With regards to the flag of possible duplication to
Impossible to cross site ajax api calls in a chrome extension? I suggest otherwise! I have investigated that question and the problem does NOT seem to be the same.
javascript jquery html ajax google-chrome-extension
|
show 13 more comments
I am building a Google Chrome browser extension that uses $.ajax
requests to send data from webpages to my server (currently hosted using localhost). The content_script.js
file that is being executed in the context of the webpages (more on content scripts) that the extension has access to runs this code:
//note: encode64String is assigned earlier in the script...
$.ajax(
type: "POST",
url: "http://localhost:8888/quartzsite/uploadendpoint.php",
type: "jsonp",
data: img: encode64String,
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
success: function(data)
console.log("The ajax request succeeded!");
console.log("The result is: ");
console.log(data);
,
error: function()
console.log("The request failed");
);
The problem is that the Ajax
request is succeeding but the data
argument that it returns is empty...
The console looks like this after the code is run:
Currently the contents of the uploadedendpoint.php
file are:
<?php
header("Access-Control-Allow-Origin: *");
echo 'This comes from php file'; die();
?>
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
This means there should be at least something being returned in the data
variable.
I have further confirmed that the request is succeeding because when I send the request to a broken url (i.e. uploaddddddendpoint.php) the code inside the $.ajax
's error
parameter is executed.
I have read similar questions like jQuery $.ajax response empty, but only in Chrome but to no avail...
UPDATE:
I have removed the invalid second type: "jsonp"
parameter entirely and have added dataType: "text/html"
. I am now getting a failed ajax
request each time the code is run.
UPDATE: Strangely changing dataType : "text/html"
to dataType : "html"
causes the ajax
request to succeed but again with a blank data
variable.
UPDATE: When using the dev toolkit to monitor the Network XHR these are the sent/response messages:
With regards to the flag of possible duplication to
Impossible to cross site ajax api calls in a chrome extension? I suggest otherwise! I have investigated that question and the problem does NOT seem to be the same.
javascript jquery html ajax google-chrome-extension
Try this on your first line of the php file:<?php echo 'This comes from php file'; die(); ?>
- Check if you get this in the console.
– Sergio
Aug 14 '13 at 22:24
what does the Network tab show? try removingjsonp
type.
– akonsu
Aug 14 '13 at 22:25
@Sergio no change...
– Brannon
Aug 14 '13 at 22:27
1
go to the network pane of your chrome dev tools and see what the script returns
– Prisoner
Aug 14 '13 at 22:31
1
@Brannon Re edit: The screenshot of the devtools suggests that your problem isn't related to JS/jQuery, but caused by something at your server's end. In your PHP snippet, you've set a response header. However, this header is absent in your screenshot. Also,Content-Length: 0
indicates that the server's response is really empty.
– Rob W
Aug 16 '13 at 13:49
|
show 13 more comments
I am building a Google Chrome browser extension that uses $.ajax
requests to send data from webpages to my server (currently hosted using localhost). The content_script.js
file that is being executed in the context of the webpages (more on content scripts) that the extension has access to runs this code:
//note: encode64String is assigned earlier in the script...
$.ajax(
type: "POST",
url: "http://localhost:8888/quartzsite/uploadendpoint.php",
type: "jsonp",
data: img: encode64String,
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
success: function(data)
console.log("The ajax request succeeded!");
console.log("The result is: ");
console.log(data);
,
error: function()
console.log("The request failed");
);
The problem is that the Ajax
request is succeeding but the data
argument that it returns is empty...
The console looks like this after the code is run:
Currently the contents of the uploadedendpoint.php
file are:
<?php
header("Access-Control-Allow-Origin: *");
echo 'This comes from php file'; die();
?>
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
This means there should be at least something being returned in the data
variable.
I have further confirmed that the request is succeeding because when I send the request to a broken url (i.e. uploaddddddendpoint.php) the code inside the $.ajax
's error
parameter is executed.
I have read similar questions like jQuery $.ajax response empty, but only in Chrome but to no avail...
UPDATE:
I have removed the invalid second type: "jsonp"
parameter entirely and have added dataType: "text/html"
. I am now getting a failed ajax
request each time the code is run.
UPDATE: Strangely changing dataType : "text/html"
to dataType : "html"
causes the ajax
request to succeed but again with a blank data
variable.
UPDATE: When using the dev toolkit to monitor the Network XHR these are the sent/response messages:
With regards to the flag of possible duplication to
Impossible to cross site ajax api calls in a chrome extension? I suggest otherwise! I have investigated that question and the problem does NOT seem to be the same.
javascript jquery html ajax google-chrome-extension
I am building a Google Chrome browser extension that uses $.ajax
requests to send data from webpages to my server (currently hosted using localhost). The content_script.js
file that is being executed in the context of the webpages (more on content scripts) that the extension has access to runs this code:
//note: encode64String is assigned earlier in the script...
$.ajax(
type: "POST",
url: "http://localhost:8888/quartzsite/uploadendpoint.php",
type: "jsonp",
data: img: encode64String,
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
success: function(data)
console.log("The ajax request succeeded!");
console.log("The result is: ");
console.log(data);
,
error: function()
console.log("The request failed");
);
The problem is that the Ajax
request is succeeding but the data
argument that it returns is empty...
The console looks like this after the code is run:
Currently the contents of the uploadedendpoint.php
file are:
<?php
header("Access-Control-Allow-Origin: *");
echo 'This comes from php file'; die();
?>
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
This means there should be at least something being returned in the data
variable.
I have further confirmed that the request is succeeding because when I send the request to a broken url (i.e. uploaddddddendpoint.php) the code inside the $.ajax
's error
parameter is executed.
I have read similar questions like jQuery $.ajax response empty, but only in Chrome but to no avail...
UPDATE:
I have removed the invalid second type: "jsonp"
parameter entirely and have added dataType: "text/html"
. I am now getting a failed ajax
request each time the code is run.
UPDATE: Strangely changing dataType : "text/html"
to dataType : "html"
causes the ajax
request to succeed but again with a blank data
variable.
UPDATE: When using the dev toolkit to monitor the Network XHR these are the sent/response messages:
With regards to the flag of possible duplication to
Impossible to cross site ajax api calls in a chrome extension? I suggest otherwise! I have investigated that question and the problem does NOT seem to be the same.
javascript jquery html ajax google-chrome-extension
javascript jquery html ajax google-chrome-extension
edited May 23 '17 at 12:08
Community♦
11
11
asked Aug 14 '13 at 22:22
BrannonBrannon
56311025
56311025
Try this on your first line of the php file:<?php echo 'This comes from php file'; die(); ?>
- Check if you get this in the console.
– Sergio
Aug 14 '13 at 22:24
what does the Network tab show? try removingjsonp
type.
– akonsu
Aug 14 '13 at 22:25
@Sergio no change...
– Brannon
Aug 14 '13 at 22:27
1
go to the network pane of your chrome dev tools and see what the script returns
– Prisoner
Aug 14 '13 at 22:31
1
@Brannon Re edit: The screenshot of the devtools suggests that your problem isn't related to JS/jQuery, but caused by something at your server's end. In your PHP snippet, you've set a response header. However, this header is absent in your screenshot. Also,Content-Length: 0
indicates that the server's response is really empty.
– Rob W
Aug 16 '13 at 13:49
|
show 13 more comments
Try this on your first line of the php file:<?php echo 'This comes from php file'; die(); ?>
- Check if you get this in the console.
– Sergio
Aug 14 '13 at 22:24
what does the Network tab show? try removingjsonp
type.
– akonsu
Aug 14 '13 at 22:25
@Sergio no change...
– Brannon
Aug 14 '13 at 22:27
1
go to the network pane of your chrome dev tools and see what the script returns
– Prisoner
Aug 14 '13 at 22:31
1
@Brannon Re edit: The screenshot of the devtools suggests that your problem isn't related to JS/jQuery, but caused by something at your server's end. In your PHP snippet, you've set a response header. However, this header is absent in your screenshot. Also,Content-Length: 0
indicates that the server's response is really empty.
– Rob W
Aug 16 '13 at 13:49
Try this on your first line of the php file:
<?php echo 'This comes from php file'; die(); ?>
- Check if you get this in the console.– Sergio
Aug 14 '13 at 22:24
Try this on your first line of the php file:
<?php echo 'This comes from php file'; die(); ?>
- Check if you get this in the console.– Sergio
Aug 14 '13 at 22:24
what does the Network tab show? try removing
jsonp
type.– akonsu
Aug 14 '13 at 22:25
what does the Network tab show? try removing
jsonp
type.– akonsu
Aug 14 '13 at 22:25
@Sergio no change...
– Brannon
Aug 14 '13 at 22:27
@Sergio no change...
– Brannon
Aug 14 '13 at 22:27
1
1
go to the network pane of your chrome dev tools and see what the script returns
– Prisoner
Aug 14 '13 at 22:31
go to the network pane of your chrome dev tools and see what the script returns
– Prisoner
Aug 14 '13 at 22:31
1
1
@Brannon Re edit: The screenshot of the devtools suggests that your problem isn't related to JS/jQuery, but caused by something at your server's end. In your PHP snippet, you've set a response header. However, this header is absent in your screenshot. Also,
Content-Length: 0
indicates that the server's response is really empty.– Rob W
Aug 16 '13 at 13:49
@Brannon Re edit: The screenshot of the devtools suggests that your problem isn't related to JS/jQuery, but caused by something at your server's end. In your PHP snippet, you've set a response header. However, this header is absent in your screenshot. Also,
Content-Length: 0
indicates that the server's response is really empty.– Rob W
Aug 16 '13 at 13:49
|
show 13 more comments
2 Answers
2
active
oldest
votes
Why do you have two type
fields in your AJAX request? jsonp
and POST
.
$.ajax(
type: "POST", // OK
url: "http://localhost:8888/quartzsite/uploadendpoint.php",
type: "jsonp", // ???
// ...
);
UPDATE:
I think you should be using the relative path for the URL. Try changing your request to the following:
$.ajax(
type: "POST",
url: "/quartzsite/uploadendpoint.php",
dataType: "text/html",
data: img: encode64String,
success: function(data)
console.log("The ajax request succeeded!");
console.log("The result is: ");
console.dir(data);
,
error: function()
console.log("The request failed");
);
You can see I replaced the URL with /quartzsite/uploadendpoint.php
. This may solve the problem... the absolute URL might signal a cross-domain request which is not what you're after.
Also, as a side note, it's unnecessary to set the contentType, since what you're setting it to is already the default value. If you were sending a JSON or XML, then you'd want to set the contentType.
Nice catch! I have removed the "jsonp" type and added the correctdataType
. The request is now failing altogether (which might actually indicate that it was previously giving a false positive).
– Brannon
Aug 14 '13 at 22:40
1
You shouldn't be using "jsonp" anywhere in your request. That is an advanced method for cross-domain requests and I doubt it's what you need. Do you still have that in there?
– ktm5124
Aug 14 '13 at 22:41
I removedjsonp
– Brannon
Aug 14 '13 at 22:42
I updated the question.
– Brannon
Aug 14 '13 at 22:52
add a comment |
One way to solve the problem:
In chrome was an empty answer.
In FF show a php warnings in the answer
Warning: .... on line ...
After removing the warnings, chrome began to display a response.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18243319%2fajax-request-succeeds-but-result-is-empty%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Why do you have two type
fields in your AJAX request? jsonp
and POST
.
$.ajax(
type: "POST", // OK
url: "http://localhost:8888/quartzsite/uploadendpoint.php",
type: "jsonp", // ???
// ...
);
UPDATE:
I think you should be using the relative path for the URL. Try changing your request to the following:
$.ajax(
type: "POST",
url: "/quartzsite/uploadendpoint.php",
dataType: "text/html",
data: img: encode64String,
success: function(data)
console.log("The ajax request succeeded!");
console.log("The result is: ");
console.dir(data);
,
error: function()
console.log("The request failed");
);
You can see I replaced the URL with /quartzsite/uploadendpoint.php
. This may solve the problem... the absolute URL might signal a cross-domain request which is not what you're after.
Also, as a side note, it's unnecessary to set the contentType, since what you're setting it to is already the default value. If you were sending a JSON or XML, then you'd want to set the contentType.
Nice catch! I have removed the "jsonp" type and added the correctdataType
. The request is now failing altogether (which might actually indicate that it was previously giving a false positive).
– Brannon
Aug 14 '13 at 22:40
1
You shouldn't be using "jsonp" anywhere in your request. That is an advanced method for cross-domain requests and I doubt it's what you need. Do you still have that in there?
– ktm5124
Aug 14 '13 at 22:41
I removedjsonp
– Brannon
Aug 14 '13 at 22:42
I updated the question.
– Brannon
Aug 14 '13 at 22:52
add a comment |
Why do you have two type
fields in your AJAX request? jsonp
and POST
.
$.ajax(
type: "POST", // OK
url: "http://localhost:8888/quartzsite/uploadendpoint.php",
type: "jsonp", // ???
// ...
);
UPDATE:
I think you should be using the relative path for the URL. Try changing your request to the following:
$.ajax(
type: "POST",
url: "/quartzsite/uploadendpoint.php",
dataType: "text/html",
data: img: encode64String,
success: function(data)
console.log("The ajax request succeeded!");
console.log("The result is: ");
console.dir(data);
,
error: function()
console.log("The request failed");
);
You can see I replaced the URL with /quartzsite/uploadendpoint.php
. This may solve the problem... the absolute URL might signal a cross-domain request which is not what you're after.
Also, as a side note, it's unnecessary to set the contentType, since what you're setting it to is already the default value. If you were sending a JSON or XML, then you'd want to set the contentType.
Nice catch! I have removed the "jsonp" type and added the correctdataType
. The request is now failing altogether (which might actually indicate that it was previously giving a false positive).
– Brannon
Aug 14 '13 at 22:40
1
You shouldn't be using "jsonp" anywhere in your request. That is an advanced method for cross-domain requests and I doubt it's what you need. Do you still have that in there?
– ktm5124
Aug 14 '13 at 22:41
I removedjsonp
– Brannon
Aug 14 '13 at 22:42
I updated the question.
– Brannon
Aug 14 '13 at 22:52
add a comment |
Why do you have two type
fields in your AJAX request? jsonp
and POST
.
$.ajax(
type: "POST", // OK
url: "http://localhost:8888/quartzsite/uploadendpoint.php",
type: "jsonp", // ???
// ...
);
UPDATE:
I think you should be using the relative path for the URL. Try changing your request to the following:
$.ajax(
type: "POST",
url: "/quartzsite/uploadendpoint.php",
dataType: "text/html",
data: img: encode64String,
success: function(data)
console.log("The ajax request succeeded!");
console.log("The result is: ");
console.dir(data);
,
error: function()
console.log("The request failed");
);
You can see I replaced the URL with /quartzsite/uploadendpoint.php
. This may solve the problem... the absolute URL might signal a cross-domain request which is not what you're after.
Also, as a side note, it's unnecessary to set the contentType, since what you're setting it to is already the default value. If you were sending a JSON or XML, then you'd want to set the contentType.
Why do you have two type
fields in your AJAX request? jsonp
and POST
.
$.ajax(
type: "POST", // OK
url: "http://localhost:8888/quartzsite/uploadendpoint.php",
type: "jsonp", // ???
// ...
);
UPDATE:
I think you should be using the relative path for the URL. Try changing your request to the following:
$.ajax(
type: "POST",
url: "/quartzsite/uploadendpoint.php",
dataType: "text/html",
data: img: encode64String,
success: function(data)
console.log("The ajax request succeeded!");
console.log("The result is: ");
console.dir(data);
,
error: function()
console.log("The request failed");
);
You can see I replaced the URL with /quartzsite/uploadendpoint.php
. This may solve the problem... the absolute URL might signal a cross-domain request which is not what you're after.
Also, as a side note, it's unnecessary to set the contentType, since what you're setting it to is already the default value. If you were sending a JSON or XML, then you'd want to set the contentType.
edited Aug 15 '13 at 2:28
answered Aug 14 '13 at 22:29
ktm5124ktm5124
7,961165489
7,961165489
Nice catch! I have removed the "jsonp" type and added the correctdataType
. The request is now failing altogether (which might actually indicate that it was previously giving a false positive).
– Brannon
Aug 14 '13 at 22:40
1
You shouldn't be using "jsonp" anywhere in your request. That is an advanced method for cross-domain requests and I doubt it's what you need. Do you still have that in there?
– ktm5124
Aug 14 '13 at 22:41
I removedjsonp
– Brannon
Aug 14 '13 at 22:42
I updated the question.
– Brannon
Aug 14 '13 at 22:52
add a comment |
Nice catch! I have removed the "jsonp" type and added the correctdataType
. The request is now failing altogether (which might actually indicate that it was previously giving a false positive).
– Brannon
Aug 14 '13 at 22:40
1
You shouldn't be using "jsonp" anywhere in your request. That is an advanced method for cross-domain requests and I doubt it's what you need. Do you still have that in there?
– ktm5124
Aug 14 '13 at 22:41
I removedjsonp
– Brannon
Aug 14 '13 at 22:42
I updated the question.
– Brannon
Aug 14 '13 at 22:52
Nice catch! I have removed the "jsonp" type and added the correct
dataType
. The request is now failing altogether (which might actually indicate that it was previously giving a false positive).– Brannon
Aug 14 '13 at 22:40
Nice catch! I have removed the "jsonp" type and added the correct
dataType
. The request is now failing altogether (which might actually indicate that it was previously giving a false positive).– Brannon
Aug 14 '13 at 22:40
1
1
You shouldn't be using "jsonp" anywhere in your request. That is an advanced method for cross-domain requests and I doubt it's what you need. Do you still have that in there?
– ktm5124
Aug 14 '13 at 22:41
You shouldn't be using "jsonp" anywhere in your request. That is an advanced method for cross-domain requests and I doubt it's what you need. Do you still have that in there?
– ktm5124
Aug 14 '13 at 22:41
I removed
jsonp
– Brannon
Aug 14 '13 at 22:42
I removed
jsonp
– Brannon
Aug 14 '13 at 22:42
I updated the question.
– Brannon
Aug 14 '13 at 22:52
I updated the question.
– Brannon
Aug 14 '13 at 22:52
add a comment |
One way to solve the problem:
In chrome was an empty answer.
In FF show a php warnings in the answer
Warning: .... on line ...
After removing the warnings, chrome began to display a response.
add a comment |
One way to solve the problem:
In chrome was an empty answer.
In FF show a php warnings in the answer
Warning: .... on line ...
After removing the warnings, chrome began to display a response.
add a comment |
One way to solve the problem:
In chrome was an empty answer.
In FF show a php warnings in the answer
Warning: .... on line ...
After removing the warnings, chrome began to display a response.
One way to solve the problem:
In chrome was an empty answer.
In FF show a php warnings in the answer
Warning: .... on line ...
After removing the warnings, chrome began to display a response.
answered Nov 15 '18 at 8:32
Федор ПересадовФедор Пересадов
111
111
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f18243319%2fajax-request-succeeds-but-result-is-empty%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try this on your first line of the php file:
<?php echo 'This comes from php file'; die(); ?>
- Check if you get this in the console.– Sergio
Aug 14 '13 at 22:24
what does the Network tab show? try removing
jsonp
type.– akonsu
Aug 14 '13 at 22:25
@Sergio no change...
– Brannon
Aug 14 '13 at 22:27
1
go to the network pane of your chrome dev tools and see what the script returns
– Prisoner
Aug 14 '13 at 22:31
1
@Brannon Re edit: The screenshot of the devtools suggests that your problem isn't related to JS/jQuery, but caused by something at your server's end. In your PHP snippet, you've set a response header. However, this header is absent in your screenshot. Also,
Content-Length: 0
indicates that the server's response is really empty.– Rob W
Aug 16 '13 at 13:49