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&ntilde;ia',         type: "warning",         confirmbuttontext: "ok!",         closeonconfirm: false     });     $(window).bind("load", function() {         $.gritter.add({             title: 'atencion',             text: 'compa&ntilde;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&ntilde;ia' gritter message correctly displaying word. (see picture) enter image description here

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&ntilde;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&ntilde;ia',         type: "warning",         confirmbuttontext: "ok!",         closeonconfirm: false,         html: true     }); 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -