Reputation: 100
I tried to using font-awesome icons but some icons show and others couldnt show. It gave me this error:
my usage :
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/js/all.min.js" crossorigin="anonymous">
<!-- Load font awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css">
</head>
...
some codes
...
</html>
<script>
...some code...
...
...
display data table:
"data": null,
"render": function (data, type, row)
{
if (row.detailPhysicalPath == "") {
return '<button id="' + row.staffCode+ '" onclick="captureClick(this)" type="button" class="btn btn-primary"><i class="far fa fa-camera"></i></button>';}
else {
return '<button id="' + row.staffCode+ '" onclick="captureClick(this)" type="button" class="btn btn-primary"><i class="far fa fa-check-circle-o"></i></button>';}
}
</script>
Upvotes: 0
Views: 87
Reputation: 96
The class name isn't far fa fa-check-circle-o
.
The correct name is fa fa-check-circle-o
.
Upvotes: 0
Reputation: 942
Here the problem is the font awesome icon name that your using is version 4, and You have included CDN of font awsome version 5
Font Awesome Version 5 : <i class="far fa-check-circle"></i>
Example:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css">
<i class="far fa-check-circle"></i>
Font Awesome Version 4 : <i class="fa fa-check-circle-o" aria-hidden="true"></i>
Example:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" />
<i class="fa fa-check-circle-o" aria-hidden="true"></i>
Upvotes: 2