Ajax not showing the server answerHow can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?How to manage a redirect request after a jQuery Ajax calljQuery Ajax error handling, show custom exception messagesAbort Ajax requests using jQueryjQuery AJAX submit formjQuery Ajax File UploadjQuery Ajax POST example with PHPSend special characters through AJAX ( “<” , “>” , “&” )How to make an AJAX call without jQuery?Is Safari on iOS 6 caching $.ajax results?
How to let other coworkers know that I don't share my coworker's political views?
Can we assume that a hash function with high collision resistance also means highly uniform distribution?
Why did Jon Snow do this immoral act if he is so honorable?
Why is 'additive' EQ more difficult to use than 'subtractive'?
shell script is not executed after adding it as a crontab job
Is keeping the forking link on a true fork necessary (Github/GPL)?
One word for 'the thing that attracts me'?
Why would a rational buyer offer to buy with no conditions precedent?
Burned out due to current job, Can I take a week of vacation between jobs?
On San Andreas Speedruns, why do players blow up the Picador in the mission Ryder?
Did this character show any indication of wanting to rule before S8E6?
Is superuser the same as root?
No Iron for your fair-folk maiden? (Part 1)
Why does splatting create a tuple on the rhs but a list on the lhs?
To exponential digit growth and beyond!
A burglar's sunglasses, a lady's odyssey
Best shape for a necromancer's undead minions for battle?
Expected maximum number of unpaired socks
Why sampling a periodic signal doesn't yield a periodic discrete signal?
Using too much dialogue?
Why was this character made Grand Maester?
Gravitational Force Between Numbers
How can I properly write this equation in Latex?
Python program for fibonacci sequence using a recursive function
Ajax not showing the server answer
How can I get jQuery to perform a synchronous, rather than asynchronous, Ajax request?How to manage a redirect request after a jQuery Ajax calljQuery Ajax error handling, show custom exception messagesAbort Ajax requests using jQueryjQuery AJAX submit formjQuery Ajax File UploadjQuery Ajax POST example with PHPSend special characters through AJAX ( “<” , “>” , “&” )How to make an AJAX call without jQuery?Is Safari on iOS 6 caching $.ajax results?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm making a simple chat in php, and when I send the user message ajax, it is not being showed in the page, I'm beginning to study ajax now, so I don't know what is wrong in the code, I did just like I saw to do in the w3schools
Now I'm just trying to check if the message will be showed in the page, not doing nothing really in the server, when I can fix this problem, I'll make the class for sending to database, I tried sending by post, but not working too
// this is the ajax in the chat.html
<script type="text/javascript">
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = chat.msg.value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readystate==4&&this.status==200)
let content = document.querySelector('#content');
content.innerHTML = this.responseText;
xml.open('get', 'ajx.php?msg='+msg, true);
xml.send();
</script>
////////////////////////////////////////////////////////////////////////////
// this is the code in the server ajx.php
$ajx = $_REQUEST['msg'];
echo $ajx;
I want the message that is being sent by ajax to the server to appear in the #content tag (I didn't put the tag here), but nothing is happening (later I'll improve the server, now I just want to fix this), if anybody want to see all the code, you can see in my github https://github.com/CristoferPortela/chatbox.git
javascript php ajax
|
show 4 more comments
I'm making a simple chat in php, and when I send the user message ajax, it is not being showed in the page, I'm beginning to study ajax now, so I don't know what is wrong in the code, I did just like I saw to do in the w3schools
Now I'm just trying to check if the message will be showed in the page, not doing nothing really in the server, when I can fix this problem, I'll make the class for sending to database, I tried sending by post, but not working too
// this is the ajax in the chat.html
<script type="text/javascript">
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = chat.msg.value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readystate==4&&this.status==200)
let content = document.querySelector('#content');
content.innerHTML = this.responseText;
xml.open('get', 'ajx.php?msg='+msg, true);
xml.send();
</script>
////////////////////////////////////////////////////////////////////////////
// this is the code in the server ajx.php
$ajx = $_REQUEST['msg'];
echo $ajx;
I want the message that is being sent by ajax to the server to appear in the #content tag (I didn't put the tag here), but nothing is happening (later I'll improve the server, now I just want to fix this), if anybody want to see all the code, you can see in my github https://github.com/CristoferPortela/chatbox.git
javascript php ajax
what error messages are in your browser dev console? what error messages are in your php logs?
– Dan O
Mar 23 at 23:11
1
where ischat.msg.value
coming from? Sure you've got data there? I'm not surechat.msg
will get auto-populated when the elements have that as name only. Better use id (and even better do an explicit select to get the msg element and it's value)
– Jeff
Mar 23 at 23:12
I looked at your repo, but it seems that you're missing the file that should actually handle the request..
– Koen.
Mar 23 at 23:12
@Koen it's there: github.com/CristoferPortela/chatbox/blob/master/chat/ajx.php
– Jeff
Mar 23 at 23:17
Ah, you pushed after I looked I guess. But like @DanO 's comment; what do you see in the browser development console?
– Koen.
Mar 23 at 23:20
|
show 4 more comments
I'm making a simple chat in php, and when I send the user message ajax, it is not being showed in the page, I'm beginning to study ajax now, so I don't know what is wrong in the code, I did just like I saw to do in the w3schools
Now I'm just trying to check if the message will be showed in the page, not doing nothing really in the server, when I can fix this problem, I'll make the class for sending to database, I tried sending by post, but not working too
// this is the ajax in the chat.html
<script type="text/javascript">
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = chat.msg.value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readystate==4&&this.status==200)
let content = document.querySelector('#content');
content.innerHTML = this.responseText;
xml.open('get', 'ajx.php?msg='+msg, true);
xml.send();
</script>
////////////////////////////////////////////////////////////////////////////
// this is the code in the server ajx.php
$ajx = $_REQUEST['msg'];
echo $ajx;
I want the message that is being sent by ajax to the server to appear in the #content tag (I didn't put the tag here), but nothing is happening (later I'll improve the server, now I just want to fix this), if anybody want to see all the code, you can see in my github https://github.com/CristoferPortela/chatbox.git
javascript php ajax
I'm making a simple chat in php, and when I send the user message ajax, it is not being showed in the page, I'm beginning to study ajax now, so I don't know what is wrong in the code, I did just like I saw to do in the w3schools
Now I'm just trying to check if the message will be showed in the page, not doing nothing really in the server, when I can fix this problem, I'll make the class for sending to database, I tried sending by post, but not working too
// this is the ajax in the chat.html
<script type="text/javascript">
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = chat.msg.value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readystate==4&&this.status==200)
let content = document.querySelector('#content');
content.innerHTML = this.responseText;
xml.open('get', 'ajx.php?msg='+msg, true);
xml.send();
</script>
////////////////////////////////////////////////////////////////////////////
// this is the code in the server ajx.php
$ajx = $_REQUEST['msg'];
echo $ajx;
I want the message that is being sent by ajax to the server to appear in the #content tag (I didn't put the tag here), but nothing is happening (later I'll improve the server, now I just want to fix this), if anybody want to see all the code, you can see in my github https://github.com/CristoferPortela/chatbox.git
javascript php ajax
javascript php ajax
asked Mar 23 at 23:07
Cristofer PortelaCristofer Portela
11
11
what error messages are in your browser dev console? what error messages are in your php logs?
– Dan O
Mar 23 at 23:11
1
where ischat.msg.value
coming from? Sure you've got data there? I'm not surechat.msg
will get auto-populated when the elements have that as name only. Better use id (and even better do an explicit select to get the msg element and it's value)
– Jeff
Mar 23 at 23:12
I looked at your repo, but it seems that you're missing the file that should actually handle the request..
– Koen.
Mar 23 at 23:12
@Koen it's there: github.com/CristoferPortela/chatbox/blob/master/chat/ajx.php
– Jeff
Mar 23 at 23:17
Ah, you pushed after I looked I guess. But like @DanO 's comment; what do you see in the browser development console?
– Koen.
Mar 23 at 23:20
|
show 4 more comments
what error messages are in your browser dev console? what error messages are in your php logs?
– Dan O
Mar 23 at 23:11
1
where ischat.msg.value
coming from? Sure you've got data there? I'm not surechat.msg
will get auto-populated when the elements have that as name only. Better use id (and even better do an explicit select to get the msg element and it's value)
– Jeff
Mar 23 at 23:12
I looked at your repo, but it seems that you're missing the file that should actually handle the request..
– Koen.
Mar 23 at 23:12
@Koen it's there: github.com/CristoferPortela/chatbox/blob/master/chat/ajx.php
– Jeff
Mar 23 at 23:17
Ah, you pushed after I looked I guess. But like @DanO 's comment; what do you see in the browser development console?
– Koen.
Mar 23 at 23:20
what error messages are in your browser dev console? what error messages are in your php logs?
– Dan O
Mar 23 at 23:11
what error messages are in your browser dev console? what error messages are in your php logs?
– Dan O
Mar 23 at 23:11
1
1
where is
chat.msg.value
coming from? Sure you've got data there? I'm not sure chat.msg
will get auto-populated when the elements have that as name only. Better use id (and even better do an explicit select to get the msg element and it's value)– Jeff
Mar 23 at 23:12
where is
chat.msg.value
coming from? Sure you've got data there? I'm not sure chat.msg
will get auto-populated when the elements have that as name only. Better use id (and even better do an explicit select to get the msg element and it's value)– Jeff
Mar 23 at 23:12
I looked at your repo, but it seems that you're missing the file that should actually handle the request..
– Koen.
Mar 23 at 23:12
I looked at your repo, but it seems that you're missing the file that should actually handle the request..
– Koen.
Mar 23 at 23:12
@Koen it's there: github.com/CristoferPortela/chatbox/blob/master/chat/ajx.php
– Jeff
Mar 23 at 23:17
@Koen it's there: github.com/CristoferPortela/chatbox/blob/master/chat/ajx.php
– Jeff
Mar 23 at 23:17
Ah, you pushed after I looked I guess. But like @DanO 's comment; what do you see in the browser development console?
– Koen.
Mar 23 at 23:20
Ah, you pushed after I looked I guess. But like @DanO 's comment; what do you see in the browser development console?
– Koen.
Mar 23 at 23:20
|
show 4 more comments
2 Answers
2
active
oldest
votes
I edited your code to the the one below and its working.
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<input id="msg">
<button id="send-mes">Send</button>
</div>
<div id="content">
</div>
<script>
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = document.querySelector('#msg').value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readyState == 4 && this.status == 200)
let content = document.querySelector('#content');
content.innerHTML = this.response;
xml.open('GET', 'ajx.php?msg='+msg, true);
xml.send();
</script>
</body>
</html>
thanks, but the message appear in the screen and immediately disappear
– Cristofer Portela
Mar 24 at 0:20
add a comment |
you could use jQuery for ajax request, its much easier than this oldschool way:
First step: Add jQuery
<head>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
second step: Ajax get methode
$.ajax(
url: 'ajx.php',
type:'GET'
dataType: 'text',
data: msg: "msg",
success: function(data)
window.alert(data);
)
I know it is easier using jquery, but I want to learn how to do without libs, some time ago I had a problem with the language because I knew how to use jquery, but no how the js really works, but thanks, I the problem continue, I'll try this
– Cristofer Portela
Mar 24 at 0:02
add console.log(msg); right after let msg = chat.msg.value; to see if there is an value in it
– Ifaruki
Mar 24 at 0:12
It show the message I typed for a moment and immediately disappear
– Cristofer Portela
Mar 24 at 0:16
where in the div or console?
– Ifaruki
Mar 24 at 0:20
well... now in both, but before that was not happening... a progress maybe?
– Cristofer Portela
Mar 24 at 0:22
|
show 8 more comments
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%2f55319204%2fajax-not-showing-the-server-answer%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
I edited your code to the the one below and its working.
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<input id="msg">
<button id="send-mes">Send</button>
</div>
<div id="content">
</div>
<script>
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = document.querySelector('#msg').value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readyState == 4 && this.status == 200)
let content = document.querySelector('#content');
content.innerHTML = this.response;
xml.open('GET', 'ajx.php?msg='+msg, true);
xml.send();
</script>
</body>
</html>
thanks, but the message appear in the screen and immediately disappear
– Cristofer Portela
Mar 24 at 0:20
add a comment |
I edited your code to the the one below and its working.
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<input id="msg">
<button id="send-mes">Send</button>
</div>
<div id="content">
</div>
<script>
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = document.querySelector('#msg').value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readyState == 4 && this.status == 200)
let content = document.querySelector('#content');
content.innerHTML = this.response;
xml.open('GET', 'ajx.php?msg='+msg, true);
xml.send();
</script>
</body>
</html>
thanks, but the message appear in the screen and immediately disappear
– Cristofer Portela
Mar 24 at 0:20
add a comment |
I edited your code to the the one below and its working.
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<input id="msg">
<button id="send-mes">Send</button>
</div>
<div id="content">
</div>
<script>
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = document.querySelector('#msg').value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readyState == 4 && this.status == 200)
let content = document.querySelector('#content');
content.innerHTML = this.response;
xml.open('GET', 'ajx.php?msg='+msg, true);
xml.send();
</script>
</body>
</html>
I edited your code to the the one below and its working.
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<input id="msg">
<button id="send-mes">Send</button>
</div>
<div id="content">
</div>
<script>
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = document.querySelector('#msg').value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readyState == 4 && this.status == 200)
let content = document.querySelector('#content');
content.innerHTML = this.response;
xml.open('GET', 'ajx.php?msg='+msg, true);
xml.send();
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<input id="msg">
<button id="send-mes">Send</button>
</div>
<div id="content">
</div>
<script>
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = document.querySelector('#msg').value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readyState == 4 && this.status == 200)
let content = document.querySelector('#content');
content.innerHTML = this.response;
xml.open('GET', 'ajx.php?msg='+msg, true);
xml.send();
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head></head>
<body>
<div>
<input id="msg">
<button id="send-mes">Send</button>
</div>
<div id="content">
</div>
<script>
let send = document.querySelector('#send-mes');
send.addEventListener('click', load);
function load()
let msg = document.querySelector('#msg').value;
let xml = new XMLHttpRequest();
xml.onreadystatechange = function()
if (this.readyState == 4 && this.status == 200)
let content = document.querySelector('#content');
content.innerHTML = this.response;
xml.open('GET', 'ajx.php?msg='+msg, true);
xml.send();
</script>
</body>
</html>
edited Mar 24 at 0:16
answered Mar 24 at 0:10
Immanuel OkekeImmanuel Okeke
92
92
thanks, but the message appear in the screen and immediately disappear
– Cristofer Portela
Mar 24 at 0:20
add a comment |
thanks, but the message appear in the screen and immediately disappear
– Cristofer Portela
Mar 24 at 0:20
thanks, but the message appear in the screen and immediately disappear
– Cristofer Portela
Mar 24 at 0:20
thanks, but the message appear in the screen and immediately disappear
– Cristofer Portela
Mar 24 at 0:20
add a comment |
you could use jQuery for ajax request, its much easier than this oldschool way:
First step: Add jQuery
<head>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
second step: Ajax get methode
$.ajax(
url: 'ajx.php',
type:'GET'
dataType: 'text',
data: msg: "msg",
success: function(data)
window.alert(data);
)
I know it is easier using jquery, but I want to learn how to do without libs, some time ago I had a problem with the language because I knew how to use jquery, but no how the js really works, but thanks, I the problem continue, I'll try this
– Cristofer Portela
Mar 24 at 0:02
add console.log(msg); right after let msg = chat.msg.value; to see if there is an value in it
– Ifaruki
Mar 24 at 0:12
It show the message I typed for a moment and immediately disappear
– Cristofer Portela
Mar 24 at 0:16
where in the div or console?
– Ifaruki
Mar 24 at 0:20
well... now in both, but before that was not happening... a progress maybe?
– Cristofer Portela
Mar 24 at 0:22
|
show 8 more comments
you could use jQuery for ajax request, its much easier than this oldschool way:
First step: Add jQuery
<head>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
second step: Ajax get methode
$.ajax(
url: 'ajx.php',
type:'GET'
dataType: 'text',
data: msg: "msg",
success: function(data)
window.alert(data);
)
I know it is easier using jquery, but I want to learn how to do without libs, some time ago I had a problem with the language because I knew how to use jquery, but no how the js really works, but thanks, I the problem continue, I'll try this
– Cristofer Portela
Mar 24 at 0:02
add console.log(msg); right after let msg = chat.msg.value; to see if there is an value in it
– Ifaruki
Mar 24 at 0:12
It show the message I typed for a moment and immediately disappear
– Cristofer Portela
Mar 24 at 0:16
where in the div or console?
– Ifaruki
Mar 24 at 0:20
well... now in both, but before that was not happening... a progress maybe?
– Cristofer Portela
Mar 24 at 0:22
|
show 8 more comments
you could use jQuery for ajax request, its much easier than this oldschool way:
First step: Add jQuery
<head>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
second step: Ajax get methode
$.ajax(
url: 'ajx.php',
type:'GET'
dataType: 'text',
data: msg: "msg",
success: function(data)
window.alert(data);
)
you could use jQuery for ajax request, its much easier than this oldschool way:
First step: Add jQuery
<head>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
second step: Ajax get methode
$.ajax(
url: 'ajx.php',
type:'GET'
dataType: 'text',
data: msg: "msg",
success: function(data)
window.alert(data);
)
answered Mar 23 at 23:37
IfarukiIfaruki
28515
28515
I know it is easier using jquery, but I want to learn how to do without libs, some time ago I had a problem with the language because I knew how to use jquery, but no how the js really works, but thanks, I the problem continue, I'll try this
– Cristofer Portela
Mar 24 at 0:02
add console.log(msg); right after let msg = chat.msg.value; to see if there is an value in it
– Ifaruki
Mar 24 at 0:12
It show the message I typed for a moment and immediately disappear
– Cristofer Portela
Mar 24 at 0:16
where in the div or console?
– Ifaruki
Mar 24 at 0:20
well... now in both, but before that was not happening... a progress maybe?
– Cristofer Portela
Mar 24 at 0:22
|
show 8 more comments
I know it is easier using jquery, but I want to learn how to do without libs, some time ago I had a problem with the language because I knew how to use jquery, but no how the js really works, but thanks, I the problem continue, I'll try this
– Cristofer Portela
Mar 24 at 0:02
add console.log(msg); right after let msg = chat.msg.value; to see if there is an value in it
– Ifaruki
Mar 24 at 0:12
It show the message I typed for a moment and immediately disappear
– Cristofer Portela
Mar 24 at 0:16
where in the div or console?
– Ifaruki
Mar 24 at 0:20
well... now in both, but before that was not happening... a progress maybe?
– Cristofer Portela
Mar 24 at 0:22
I know it is easier using jquery, but I want to learn how to do without libs, some time ago I had a problem with the language because I knew how to use jquery, but no how the js really works, but thanks, I the problem continue, I'll try this
– Cristofer Portela
Mar 24 at 0:02
I know it is easier using jquery, but I want to learn how to do without libs, some time ago I had a problem with the language because I knew how to use jquery, but no how the js really works, but thanks, I the problem continue, I'll try this
– Cristofer Portela
Mar 24 at 0:02
add console.log(msg); right after let msg = chat.msg.value; to see if there is an value in it
– Ifaruki
Mar 24 at 0:12
add console.log(msg); right after let msg = chat.msg.value; to see if there is an value in it
– Ifaruki
Mar 24 at 0:12
It show the message I typed for a moment and immediately disappear
– Cristofer Portela
Mar 24 at 0:16
It show the message I typed for a moment and immediately disappear
– Cristofer Portela
Mar 24 at 0:16
where in the div or console?
– Ifaruki
Mar 24 at 0:20
where in the div or console?
– Ifaruki
Mar 24 at 0:20
well... now in both, but before that was not happening... a progress maybe?
– Cristofer Portela
Mar 24 at 0:22
well... now in both, but before that was not happening... a progress maybe?
– Cristofer Portela
Mar 24 at 0:22
|
show 8 more comments
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%2f55319204%2fajax-not-showing-the-server-answer%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
what error messages are in your browser dev console? what error messages are in your php logs?
– Dan O
Mar 23 at 23:11
1
where is
chat.msg.value
coming from? Sure you've got data there? I'm not surechat.msg
will get auto-populated when the elements have that as name only. Better use id (and even better do an explicit select to get the msg element and it's value)– Jeff
Mar 23 at 23:12
I looked at your repo, but it seems that you're missing the file that should actually handle the request..
– Koen.
Mar 23 at 23:12
@Koen it's there: github.com/CristoferPortela/chatbox/blob/master/chat/ajx.php
– Jeff
Mar 23 at 23:17
Ah, you pushed after I looked I guess. But like @DanO 's comment; what do you see in the browser development console?
– Koen.
Mar 23 at 23:20