javascript - Sweet Alerts is display UTF-8 Chars wrong -
i don't know wrong, have javascript function:
<script charset="utf-8" type="text/javascript"> $(document).ready(function(){ //initialize javascript app.init(); @if(session::has('message')) var msg = '{{ session::get('message') }}'; console.log(msg); swal({ title: "", text: 'compañia', type: "warning", confirmbuttontext: "ok!", closeonconfirm: false }); $(window).bind("load", function() { $.gritter.add({ title: 'atencion', text: 'compañia', image: '{{ asset('images/clipboard_icon.png') }}', class_name: 'danger', time: '' }); return false; }); @endif }); </script>
the problem sweet alerts doesn't display: 'compaƱia'
displays 'compañia'
gritter message correctly displaying word. (see picture)
as can see red gritter correctly displays word, sweet alert doesn't,
the file utf-8 encoded, meta , script in case, , before ask why put 'compañia'
part of larger message send laravel on session , retrieved view in format.
anyway real question why gritted display word fine , how can fix works on sweet alert.
i fixed adding html: true
function:
swal({ title: "", text: 'compañia', type: "warning", confirmbuttontext: "ok!", closeonconfirm: false, html: true });
Comments
Post a Comment