Welcome Guest, Not a member yet? Register   Sign In
API response breaking special characters in French
#3

(This post was last modified: 08-17-2021, 06:11 AM by gosocial2.)

This is the part I have to reveal
Code:
$message = lang('Basic.global.deleteSuccess');
Even when
PHP Code:
$message "L\'enregistrement de Ville a été supprimé avec succès."

did not change the result, but changing  respondDeleted(...) method to the following:

PHP Code:
$response $this->respondDeleted(['id' => $id'msg'=>$message]);
return $response

and in JS
Code:
$.ajax({
    url: `<?= route_to('cities') ?>/${dataId}`,
    method: 'DELETE',
}).done((data, textStatus, jqXHR) => {
    alert(data.msg);
    // instead of alert(jqXHR.statusText); worked !!!
});

I have yet to work out what happens with

PHP Code:
$this->failServerError( ... ) 

though.



InsiteFX said:

Try changing the nwssage string.
PHP Code:
// change this
$message 'L\'enregistrement de Ville a été supprimé avec succès.';

// to this
$message "L\'enregistrement de Ville a été supprimé avec succès."

Not tested, but sometimes it depends on the type of quotes.

CodeIgniter Wizard (CRUD code generator for Mac) instantly scaffolds Bootstrap-based web applications with an administrative interface (admin templates include Bootstrap5)

Reply


Messages In This Thread
RE: API response breaking special characters in French - by gosocial2 - 08-17-2021, 05:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB