I am developing a web application using PHP,Smarty for a french client. I am facing a problem in java script alert and confirm boxes. How can I use HTML special characters in javascript message boxes. This is my code
<script type="text/javascript">
function delConfirm(key){
if(confirm('Êtes vous certain de vouloir supprimer ce client ?')){
window.location = "deleteClient.php?e="+key;
}
}
</script>
This is the page source of the first part of the page. Please take a look at the encoding section too,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Sunil">
That’s correct, because
confirmdoesn’t accept HTML. You can use unicode escape sequence in JavaScript, though. You can look up Unicode code point values here. The equivalent ofÊisU+00CA(it’s on this chart), so:Alternately, ensure that your file is correctly encoded (in UTF-8 for example), that your editor understands files encoded in that way, and that the file is served correctly (the server tells the browser it’s UTF-8), maybe even throw in a
meta charset="xxx"tag in the header for luck, and you can just type the French characters directly into the file.