admin管理员组文章数量:1429648
I have this French string:
Veuillez indiquer vos spécialités
I want it like this in my JS Alert:
Veuillez indiquer vos spécialités
Here is my code:
$(function(){
alert('Veuillez indiquer vos spécialités');
});
Fiddle here : /
I have this French string:
Veuillez indiquer vos spécialités
I want it like this in my JS Alert:
Veuillez indiquer vos spécialités
Here is my code:
$(function(){
alert('Veuillez indiquer vos spécialités');
});
Fiddle here : http://jsfiddle/M6rLL/
Share Improve this question edited Nov 27, 2013 at 10:03 Martijn 16.2k4 gold badges38 silver badges72 bronze badges asked Nov 27, 2013 at 9:46 Hassan SardarHassan Sardar 4,52317 gold badges61 silver badges92 bronze badges 2- 2 alert('Veuillez indiquer vos sp\351cialit\351s'); – krasu Commented Nov 27, 2013 at 9:50
-
PHPJS's
html_entity_decode
– h2ooooooo Commented Nov 27, 2013 at 9:51
1 Answer
Reset to default 6Since you are using jQuery:
$(function(){
var frenchy = 'Veuillez indiquer vos spécialités';
alert( $('<div />').html( frenchy ).text() );
// If performance is an issue, you can change the dom creation of the div:
// alert( $(document.createElement('div')).html( frenchy ).text() );
});
And the jsFiddle Demo. And this answer explains why the latter is faster :)
本文标签: jqueryConvert ampeacute to its orignal form in JavascriptStack Overflow
版权声明:本文标题:jquery - Convert &eacute; to its orignal form in Javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745542111a2662539.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论