我复制后来修改了下面的代码。 它显示'JQuery的Hello,World!'网页上的字符串。简要展示'Out of JQuery';我的意思是它几乎立刻就消失了。并且代码结束处理,使浏览器在一个循环上运行,在选项卡上显示“连接”。 我做错了什么?
<!DOCTYPE html>
<!---******* HEAD *******-->
<head>
<!-- JQuery -->
<script src="../js/jquery-3.2.0.js"></script>
<title>Testing JQuery</title>
</head>
<!---******* BODY *******-->
<body>
<title>The jQuery Example</title>
<script type="text/javascript">
document.write("Java enabled: " + navigator.javaEnabled());
</script>
<script type = "text/javascript">
$(document).ready(function(){
document.write("JQuery's Hello, World!");
});
</script>
<p> Out of JQuery </p> <!-- Does not display -->
</body>
</html>
答案 0 :(得分:0)
+----+---------+-----------------+------------+-----------------+
| ID | Stage | Action | Time | Last_Action |
+----+---------+-----------------+------------+-----------------+
| 1 | CEO | Decline | 11/01/2016 | requestmoreinfo |
| 1 | CEO | Approve | 11/02/2016 | requestmoreinfo |
| 1 | CEO | Approve | 11/03/2016 | requestmoreinfo |
| 1 | CEO | requestmoreinfo | 11/04/2016 | requestmoreinfo |
| 1 | Manager | requestmoreinfo | 11/05/2016 | Decline |
| 1 | Manager | requestmoreinfo | 11/06/2016 | Decline |
| 1 | Manager | Approve | 11/07/2016 | Decline |
| 1 | Manager | Decline | 11/08/2016 | Decline |
| 2 | User | Decline | 11/09/2016 | Approve |
| 2 | User | Decline | 11/10/2016 | Approve |
| 2 | User | Approve | 11/11/2016 | Approve |
+----+---------+-----------------+------------+-----------------+
短暂显示然后消失的原因是因为在已加载的文档上调用Out of Jquery
会清除当前文档:
来源:https://developer.mozilla.org/en-US/docs/Web/API/Document/write
注意:当document.write写入文档流时,在已关闭(加载)的文档上调用document.write会自动调用document.open,这将清除文档。
至于你的其他问题,我无法重新创建它。