javascript:alert('hello!');
data:text/html,<h1>Hello, world!</h1>
地址栏输入:
data:text/html, <html contenteditable>
控制台输入:
document.body.contentEditable='true';
var a = document.createElement('a');
a.href = 'https://www.maomin.club';
console.log(a.host); // www.maomin.club
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="app">我是内容</div>
<script type="text/javascript">
console.log(app.textContent) // 我是内容
</script>
</body>
</html>
<script src="//cdn.bootcdn.net/ajax/libs/vue/3.0.11/vue.cjs.js"></script>
<script type="text" id="template">
<h1>This won't display</h1>
</script>
<script type="text/javascript">
const text = document.getElementById('template').textContent;
console.log(text); // <h1>This won't display</h1>
</script>
*{
cursor: none!important;
}
p {
color: transparent;
text-shadow: #111 0 0 5px;
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
style{
display: block;
}
</style>
</head>
<body>
<style contentEditable>
body { color: blue }
</style>
</body>
</html>
<div style="width: 100%; position: relative; padding-bottom: 56.25%;">
<div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0;background-color:yellow;">
this content will have a constant aspect ratio that varies based on the width.
</div>
</div>
if (window.location != window.parent.location) window.parent.location = window.location;
function generateRandomAlphaNum(len) {
var rdmString = "";
for (; rdmString.length < len; rdmString += Math.random().toString(36).substr(2));
return rdmString.substr(0, len);
}
console.log(~~1.2); // 1