Own Ajax requests not working

3 replies · opened Nov 25, 2023

EecifyitNov 25, 2023

Hello,

I'm already using Canvas for a while. The problem that I encounterd is that I can't do Ajax requests with my own scripts. Can you help me out?

Thanks,

Danny

SSemicolon WebSTAFFNov 27, 2023

Hello,

Absolutely! Can you please provide us with a Live Sample URL and the Code Snippets of your AJAX Request so that we can check further and provide you with more accurate solutions? Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

EecifyitNov 27, 2023

Hello,

Thank you for your support!
You can check my project on http://dev.in2.city
When I reactivate all the code in functions.js from Canvas you won't be able to login or do other stuff because I use jQuery Ajax requests.

Here is my login snippet:

$('body').on('click', '#login', function () {
$('#login').prop('disabled', true);
$("[id^=error]").html('');
$('#loginLoader').removeClass('hidden');
$.ajax({
type: "POST",
dataType: 'JSON',
data: {login: true, email: $('#email').val(), password: $('#password').val(), token: $('#token').val()},
success: function (r) {
// alert(r);
$('#login').prop('disabled', false);
$('#loginLoader').addClass('hidden');
if (!r.validation) {
$('#login').prop('disabled', false);
$('#password').val('');
$('#token').val(r.token);
SetErrors(r);
if (r.code) {
GoTo(r, 2);
}
} else {
GoTo(r, 0);
}
}
});
});

Thanks again!

Danny

SSemicolon WebSTAFFNov 28, 2023

Hello,

Apologies for the Inconveniences caused!

We had tried checking your Page but it returns an error. Additionally, we can assure it is highly unlikely that this issue is related to Canvas. Because Canvas does not enforce or interfere with external or 3rd party codes. Please consider checking if you have the .form-widget Added to the DIV that encloses the Form, if yes, then remove it. If the issue still persists, then please update the codes and provide us with a Valid Live URL so that we can check this issue further and fix this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard