I am using jquery ajax to display some values inside the label when some value is selected from select box. but the value that i want to display in label is some different font and I think that is why the value is displayed with some question mark characters with black quad box as background [#nb-am-h��#w] . How to avoid this:
//Javascript code
<script type="text/javascript">
$("document").ready(function(){
var id=$(this).val();
//alert(id);
$.ajax({
type: "POST",
url: "ajax.php",
data: {id:id},
cache: false,
success: function(html){
//alert(html);
$("#malid").show();
/*$('#malid').css("font-family", "malfont");*/
$("#malid").html(html);
}
});
);
HTML code
<div>
<label>Book</label>
<select id="bookname">
<?php
for($i=0;$i<$count;$i++)
{
?>
<option value="<?php echo $bookid[$i];?>"><?php echo $book_name[$i];?> </option>
<?php
}
?>
</select>
<label id="malid" style="display:none;font-family: 'malfont';"></label>
</div>
//Php code inside ajax.php
if(isset($_POST['id']))
{
$id=$_POST['id'];
$book_results = $mysqli->query("SELECT book FROM booktable where book_id='$id'");
$row = $book_results->fetch_assoc();
$book = $row['book'];
echo $book;
}