Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $("#LanguageSwitcher").change(function(){
- var locale = $(this).val();
- var _token = $('meta[name="csrf-token"]').attr('content');
- $.ajax({
- url: "/language",
- type: 'POST',
- data: {locale: locale, _token: _token},
- datatype: 'json',
- beforeSend: function () {
- console.log('before send - ' + locale);
- },
- success: function (data) {
- console.log('success');
- },
- error: function (error) {
- console.log(error);
- },
- complete: function (data) {
- window.location.reload(true);
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement