html:
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>test</title>
<link rel="stylesheet" href="./showbox.css">
</head>
<body>
<script src="./jQuery-1.12.4.js"></script>
<script src="./showbox.js"></script>
<script>
$(function(){
var box = new ShowBox();
box.push("hello world");
});
</script>
</body>
</html>
js:
(function(){
function ShowBox(){};
ShowBox.prototype = {
push:function(content){
var layer = "<div class="showbox_layer"></div>";
if(content){
$("html,body").html(layer);
}
}
}
window.ShowBox = ShowBox;
}());
The jquery in the page is introduced normally.
question: after running the page, F12 calls up the console. The head section has no content, and the page style does not take effect. (style has been determined to be introduced)