Set the variables from javascript

38 views
Skip to first unread message

Faizali

unread,
Jan 16, 2017, 11:30:29 PM1/16/17
to SoPHIE Community
How can I set the variables using the javascript in the generic code in the sophie.

Steffen

unread,
Jan 17, 2017, 8:00:51 AM1/17/17
to SoPHIE Community
Hello Faizali,

I assume that you are referring to SoPHIE variables here? To accomplish this you need to have a look at the jquery ajax requests. The code below is the basic structure that you need to perform such actions. Within the data array you are able to send your values to the server and these can be accessed within the Ajax Script tab. The default script shows how parameters can be retrieved there.

jQuery.ajax({
url: '/expfront/ajax/process',
data: {
contextChecksum: jQuery('#contextChecksum').val(),
},
dataType: 'json',
async: true,
error: function(jqXHR, textStatus, errorThrown) {

},
success: function(result, textStatus, jqXHR) {
}
});

I hope that solves your problems. 

Kind regards
Steffen Beverborg
Reply all
Reply to author
Forward
0 new messages