- Posts: 6
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Ajax post data not working
- wilson31begijnendijk
- Topic Author
- Offline
- New Member
Less
More
4 years 4 weeks ago - 4 years 4 weeks ago #195566
by wilson31begijnendijk
Ajax post data not working was created by wilson31begijnendijk
Hi,
Is there any reason why this short test script should not work ?
It works fine if I skip the line [data:{test:"yeseys"},] but ofcourse I would like to post some data from the previous questions.
$.ajax({
method:'post',
url:'/AdminLTE/Limesurvey/test.php',
dataType: 'json',
data:{test:"yeseys"},
success:function(d) {
alert (d.doh);
}
});
Thanks for any input.
Frans
Is there any reason why this short test script should not work ?
It works fine if I skip the line [data:{test:"yeseys"},] but ofcourse I would like to post some data from the previous questions.
$.ajax({
method:'post',
url:'/AdminLTE/Limesurvey/test.php',
dataType: 'json',
data:{test:"yeseys"},
success:function(d) {
alert (d.doh);
}
});
Thanks for any input.
Frans
Last edit: 4 years 4 weeks ago by wilson31begijnendijk.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 4 weeks ago #195585
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Ajax post data not working
Expression system check for {something}
Then to disable Expression add space (or new line
data:{
test:"yeseys"
},
Then to disable Expression add space (or new line
data:{
test:"yeseys"
},
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3964
4 years 4 weeks ago #195597
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Ajax post data not working
Hi, Frans,
I usually use this (without json):
I usually use this (without json):
Code:
$(document).on('ready pjax:scriptcomplete',function(){ $.post('https://www.myServer.de/myFolder/getResult.php' , {sid: "{SID}", age: "{Q1}", gender: "{Q2}" } ,function(data) { $('#question{QID} input[type="text"]').val(data); //returned value }); // $('#question{QID}').hide(); });
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- wilson31begijnendijk
- Topic Author
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
4 years 4 weeks ago #195598
by wilson31begijnendijk
Replied by wilson31begijnendijk on topic Ajax post data not working
Thank you !!!
Forgot the fact that curved brackets were used for reserved variables.
Got it to work now.
Forgot the fact that curved brackets were used for reserved variables.
Got it to work now.
The topic has been locked.