I have written a very simple index.html file where I have included scripts and also styles
<!DOCTYPE html>
<html>
<head>
<title>Image Gallery</title>
<meta name="viewport" content="width=device-width">
<link rel="icon" href="images/favicon.ico" type="image/gif" sizes="16x16">
<link rel="stylesheet" type="text/css" href="css/mediaQuery.css">
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
<script src="js/searchComponent.js"></script>
<script src="js/service.js"></script>
</body>
</html>
searchComponent.js:
function Search() {
}
Search.prototype.fnInitialiseSearchComponent = function() {
var header = document.createElement("div");
header.class = 'header';
$('body').get(0).appendChild(header);
header.innerHTML = '<input type="text" name="search" id="search-text" placeholder="search images">';
}
When trying to run the application the unicode is getting appended from somewhere and throwing an error
Any help would be appreciated.
Try this: Delete the entire Search function and retype it.
This will remove any hidden unicode character.
I hope it helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.