Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $(document).ready(function(){
  2. $("#LanguageSwitcher").change(function(){
  3. var locale = $(this).val();
  4. var _token = $('meta[name="csrf-token"]').attr('content');
  5.  
  6. $.ajax({
  7. url: "/language",
  8. type: 'POST',
  9. data: {locale: locale, _token: _token},
  10. datatype: 'json',
  11. beforeSend: function () {
  12. console.log('before send - ' + locale);
  13. },
  14. success: function (data) {
  15. console.log('success');
  16. },
  17. error: function (error) {
  18. console.log(error);
  19. },
  20. complete: function (data) {
  21. window.location.reload(true);
  22. }
  23. });
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement